Posts by Lucy • 111 points
4 posts
-
0
votes1
answer83
viewsQ: Error copy file in C language
Hi! I’m trying to create a copy of a C file, but I’m not able to copy the content, it’s just creating a new blank file, can anyone see where I’m going wrong? #include <stdio.h> int main() {…
-
3
votes1
answer91
viewsQ: C file creation error
I am trying to create a C file but it is not working. The operating system is Linux. #include <stdio.h> void main (FILE *file) { file = fopen("/home/Documentos/teste.odt", "w"); fprintf(file,…
-
3
votes2
answers1886
viewsQ: Gets function on Linux
I’m trying to use the function gets (language C), but it doesn’t work. Am I using it wrong? The code is like this: #include <stdio.h> typedef struct { int matricula; char nome[40]; int nota_1;…
-
5
votes3
answers10734
viewsQ: Recursion to return numbers from 0 to n
I’m trying to make a recursive function that returns the n numbers of 0 until n, my code went like this: #include <stdio.h> int imprimenumeros(int n){ if (n==1) return 1; else return…