what does buff means..
like i see program that has
buff[256]
can anyone tell me what does this means. thenax
what does buff means..
like i see program that has
buff[256]
can anyone tell me what does this means. thenax
I think you have got :
char buff[256]
which declares an array of 256 chars (and is used as a buffer maybe)
ya that is what i meant buffer as i see now i posted it wrong.. so what is it really doing like i have this program that i keep getting erros..
#include <stdio.h>
#include <string.h>
int main(void)
{
char buffer[256];
printf(" enter name and press enter ");
fgets(buffer,256,stdin);
printf(" \nyour name has %d chars and spaces\n",stdin( buffer )-1);
return 0;
}
now im tring to see what this program doe... (its in linux) the error that i get is "test.c:12: called object is not a function" hhmm any help... thanx
char buffer[256] is just an array in which input is stored.
Try :
#include <stdio.h>
#include <string.h>
int main(void)
{
char buffer[256];
printf(" enter name and press enter ");
fgets(buffer,256,stdin);
printf(" \nyour name has %d chars and spaces\n",strlen(buffer));
return 0;
}
>stdin( buffer )-1);
That was what went wrong, stdin is not a function.
so what is that -1 for if you dont mind me asking
> so what is that -1 for if you dont mind me asking
It's not for anything in this case, because it was used wrong.
What it was probably supposed to be for, was use with fgets, which was actually using it incorrectly anyway.
The '-1' is not needed at all for correct usage here.
Quzah.
Hope is the first step on the road to disappointment.