Posts by Junior Nascimento • 134 points
12 posts
-
1
votes2
answers94
viewsA: Check if a number is integer, if not, make the user type again
You can do it this way: std::cout << "Digite um número: "; do{ std::cin >> number; if(number%2 == 0){ std::cout << "O número é real positivo" << std::endl }else{ std::cout…
c++answered Junior Nascimento 134 -
0
votes3
answers95
viewsA: If counter in a text file
I did it in a more performative way in relation to memory, since the functions of the string.h copy the strings. In performance issue is not notorious, only in incredibly large files. I also do not…
-
0
votes2
answers205
viewsA: How to store data from a struct in a vector (c++)
Your problem is not in how to store the struct, by your error, what is happening is a problem in the link, recommend to see that answer What I recommend to you is to move the statement of vector…
-
0
votes1
answer28
viewsQ: Visualstudio Designer does not generate some variables
In the Visualstudio 2010 I am having this problem, where some components have no variables and they are initialized in the method InitializeComponent. But in this way the components are not…
-
1
votes2
answers480
viewsA: Display matrix in python
From what I understand you want to display the matrix in a way that is more friendly, separating into rows into columns, you can do it as follows: for i in range(len(data)): for j in…
-
0
votes1
answer56
viewsA: Problem in C MATRIX display
In C (and in the vast majority of languages) the arrays (vectors are one-dimensional arrays and matrices are multidimensional arrays as you should know) have indices ranging from 0 (zero) to n-1…
canswered Junior Nascimento 134 -
0
votes2
answers4985
viewsA: How to read string with space in a repeat structure?
You can quickly solve your problem by consuming all the buffer so that the "n" doesn’t get in the way of other readings. a method that works very well is this: void flush_in(){ int ch; while( (ch =…
canswered Junior Nascimento 134 -
3
votes3
answers98
viewsA: Incorrect reading of floating point
Since you didn’t show all your code I wrote a small code that reads from a text file with the same formatting that your code reads. file. c #include <stdio.h> #include <stdlib.h> int…
-
1
votes1
answer226
viewsA: Trouble sorting code with Shellsort
After reading a little about Sort shell I found some problems in your code, like in most sorting algorithms, the examples are given with integer vectors, but note that you have a struct vector, so…
-
0
votes1
answer85
viewsQ: Unable to view event details created in the first faces Schedule
This is intriguing me has a time, use in the project the Schedule of the primefaces to add events, even then it’s okay, all the computers add and send to the online database, there is also a method…
-
1
votes0
answers112
viewsQ: Audio stream
I am developing an application that has in one of the functions play a streaming from a radio, the problem is that it worked on 1 Moto G2, 1 Moto G3 and on my ASUS Zenfone 2 LASER, it just doesn’t…
-
1
votes1
answer110
viewsQ: View Spinner Progressidialog?
Well I need to do a long task so I did a Progressdialog to inform such task, however the spinner that should be appearing seems hidden or something. protected void onPreExecute (){…