|
-
Mar 18th, 2002, 08:20 AM
#1
Thread Starter
New Member
How Can I write strings in a new line with C Ansi ?e
I wanna write string in a new line. How can i do that ?
int main(int argc, char* argv[])
{
FILE *ponteiro_arquivo;
int i =0;
strcpy(sLinha, "0001 123456 nf 0,12\n"); /* copy 1 line*/
for (i =0 ; i < 5; i++)
if((ponteiro_arquivo = fopen ("c:\\gravar.txt", "w"))!= NULL){
fprintf(ponteiro_arquivo, sLinha);
/*always writing only the last line */
fclose (ponteiro_arquivo);
}
Thanks for help me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|