segmentation fault please help

Joined
Feb 4, 2010
Messages
1
Reaction score
0
I dont know whats wrong with my code so ig anyone could please help me i keep getting segmetation fault

#include<stdio.h>

int main(){
char s[100];
FILE*f=fopen("rec1.txt","r");
if(f==NULL)printf("greska");
FILE*g=fopen("reci2.txt","w");
if(g==NULL)printf("greska");

while(fscanf(f,"%s",s)!=EOF){
fprintf(g,"%s",s);}

fclose(f);
fclose(g);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top