R
rudra
hello friends,
in a code i am trying to retrive the machine bit the code. The code
is:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
main(){
FILE *stream;
char sys[8],*sysptr;
int bit;
sysptr = &sys[0];
sys[6] = 0x0;
stream=popen("file /sbin/init|awk '{print $3}'|cut -c0-2","r");
fread(sysptr,1,2,stream);
pclose(stream);
printf("bit=%s",sysptr);
}
and the output is
bit=32�
why the irritating symbol after 32 is coming? can you suggest me
something?
in a code i am trying to retrive the machine bit the code. The code
is:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
main(){
FILE *stream;
char sys[8],*sysptr;
int bit;
sysptr = &sys[0];
sys[6] = 0x0;
stream=popen("file /sbin/init|awk '{print $3}'|cut -c0-2","r");
fread(sysptr,1,2,stream);
pclose(stream);
printf("bit=%s",sysptr);
}
and the output is
bit=32�
why the irritating symbol after 32 is coming? can you suggest me
something?