ازيكم يا جماعة
أنا عندى مشكلة
i have hard coded string & i want to write it in a file
but when i cat the file ,it hasn't the whole string
here is the code
after declaring the vars
strcpy(strin,"host username ");
fdd=open("logfil",O_RDWR|O_CREAT|O_APPEND,600);
// printf("%s\n",strin);
write(fdd,strin,sizeof(strin));
write(fdd,"\n",2);
eman samir كتب:ازيكم يا جماعة
أنا عندى مشكلة
i have hard coded string & i want to write it in a file
but when i cat the file ,it hasn't the whole string
here is the code
after declaring the vars
strcpy(strin,"host username ");
fdd=open("logfil",O_RDWR|O_CREAT|O_APPEND,600);
// printf("%s\n",strin);
write(fdd,strin,sizeof(strin));
write(fdd,"\n",2);
i declared the strin as :
char *strin;
strin=(char *)malloc(sizeof(char *)*512);
//////////////////////////////////////////////////////
i hope you can help me &tell me the mistake i made ,as i'm going to go mad