![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Location: Poway, CA
Posts: 13
Rep Power: 0
![]() |
beginner question
how do i write a function that outputs a newline character, and output the newline character throught fputc.
|
|
|
|
|
|
#2 | |
|
Programmer
Join Date: Dec 2005
Posts: 65
Rep Power: 3
![]() |
Quote:
fputc('\n', stdout);printf("\n");fprintf(stdout, "\n"); |
|
|
|
|
|
|
#3 |
|
Newbie
|
fputc('\n', stdout); works... if you must use fputc.
__________________
... after all, we're all alike. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
I'm curious, why do you want to do it with fputc?
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#5 | |
|
Programmer
Join Date: Dec 2005
Posts: 65
Rep Power: 3
![]() |
Quote:
|
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Jan 2006
Location: Poway, CA
Posts: 13
Rep Power: 0
![]() |
i just thought fputc is the simpliest way to do it
|
|
|
|
|
|
#7 |
|
Newbie
|
It depends on where you want to output it to, if you want to output it to standard output (console), the simplest way to do it is with something like printf("\n"); or putchar('\n');.
__________________
... after all, we're all alike. |
|
|
|
|
|
#8 |
|
Newbie
|
oh and... next time you post... please make the title of the thread a bit more descriptive of the problem "fputc problem" or something like that would be great, thanks.
__________________
... after all, we're all alike. |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Jan 2006
Location: Poway, CA
Posts: 13
Rep Power: 0
![]() |
alright , i will do my best
and thanks for the help everybody |
|
|
|
|
|
#10 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Yes do read the "How to post a question" thread, at the top of the forum.
If you can use C++, then you will find using std::cout a better alternative.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|