Posts by Drinjer • 317 points
7 posts
-
4
votes2
answers197
viewsQ: When to use Factory in abstract classes?
Abstract classes are classes that cannot be instantiated and their implementation depends on other classes, but using the keyword Factory can "instantiate" an abstract class. So, how and when to use…
-
3
votes1
answer95
viewsQ: Why does "var" force type inference?
Performing some tests with the language I noticed that when we use the keyword var Dart will "force" the type inference, but when we use a type to declare variables this does not happen. The test I…
-
2
votes1
answer65
viewsA: File with strange characters
#include <stdio.h> #include <stdlib.h> #include <locale.h> #include <string.h> main(){ setlocale(LC_ALL,"portuguese"); FILE *arquivo; char frase[6]; char frase2[6]; int i;…
-
6
votes1
answer302
viewsQ: Do you have anything like the C# namespaces in Java?
I noticed the size of the command to put a message on the screen in Java, wanted to know if it has how to decrease? As in C# that the programmer puts the word using "namespace"; and you can use the…
-
1
votes2
answers1337
viewsA: What is the best way to clean the keyboard buffer
Problems with the keyboard buffer is usually caused by the scanf() function;(As far as I know so far). A brief description of this "problem": This problem only occurs (I may be wrong) when we want…
-
0
votes2
answers81
viewsA: Problems in C algorithm
... printf("Digite o codigo de seu cargo: "); printf("%s",&cargo);/* Aqui deve ser a função scanf e não printf, ou se for printf tem que tirar o & depois da virgula*/ ...
-
2
votes1
answer104
viewsA: I’m having doubts in this puzzle, I can’t find the error in the program
You are using the wrong printf function, when you place the % and follow with the type indication then this already "reserving" the variable location. Ex.: . . . char Nome[20] = "Niguém"; int idade…