please, I have next code:
#include <stdio.h>
void main(void)
{
FILE *etc
etc=fopen("\\adress_of_file","r");
char caracter;
int a;
char sir[60];
for(a=0;character=fgetc(etc);i++)
sir=character;
}
//This code after run gave me something very strange like: %^@#^+&*^%
//I don't understand, function's type fgetc() is int but I want copy a text from file into string rename char sir[60] and I change character=fgetc(etc), character is a char variable.
//please, give me a...
Copy characters from a file into C programs
#include <stdio.h>
void main(void)
{
FILE *etc
etc=fopen("\\adress_of_file","r");
char caracter;
int a;
char sir[60];
for(a=0;character=fgetc(etc);i++)
sir=character;
}
//This code after run gave me something very strange like: %^@#^+&*^%
//I don't understand, function's type fgetc() is int but I want copy a text from file into string rename char sir[60] and I change character=fgetc(etc), character is a char variable.
//please, give me a...
Copy characters from a file into C programs