Can anyone tell me?
Thanks & Bst Rgds
Can anyone tell me?
Thanks & Bst Rgds
What do u mean?
Do u mean:
string[] = "hello";
or
string[ 6 ] = "hello";
or
*sPtr = "hello";
?
Sorry, I think I don't list my opinion clearly.
Here is my program's situation, I need use the string variable repeatly in a loop like this:
declare block :
char linebuf[20];
char *c;
.
.
program block :
c = linebuf;
while(..)
{
while(...)
{
c = &linebuf[0];
.
*c = *p;/*p: another pointer to an input string*/
p++;
c++;
.
.
}
strcpy(another string, linebuf);
}
fputs(another string,outfile);
if the infile's format like : 'aaaaaaaaaaaaaa'
'bbbbbb '
'c '
.
I found the result of the outfile is not which my needed. It'd like
this format :
'aaaaaaaaaaaaaa'
'bbbbbbaaaaaaaa'
'cbbbbbaaaaaaaa'
.
So I want to put the linebuf to null or space after each loop, what method can I use?
Best Rgds.
The empty string is obtained by doing this
buff[0] = '\0';
Which is fine if you just use the likes of strcpy and strcat
If you do your own char manipulations in the buffer, you might want to empty the whole buffer, like so
memset ( buff, 0, sizeof(buff) );
Hi,Salem
Thank you very much.