Posts by B612 • 39 points
3 posts
-
-4
votes1
answer30
viewsQ: Doubt on how to read a line in C (sscanf)
My goal is to read 2 user lines, where each line has a number n >= 0 of integers, separated by space. The problem is that, when n = 0 (which is the case of line 2 of the code below), the program…
-
2
votes1
answer60
viewsQ: Reading numbers in C
I wrote this code to read multiple numbers on the keyboard. I want the reading to end when the user presses Enter. But when I press Enter, he keeps waiting for new entrances. #include…
-
1
votes2
answers103
viewsQ: Memory organization when there is inheritance
When I declare funcionario as Pessoa in the main(), where the attribute value "goes" to salario, since the class Pessoa does not have that attribute? public abstract class Pessoa { private String…