How to make it in C? (me again:P)

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
zsepi
Learning poster
Posts: 51
Joined: Thu Sep 26, 2002 7:43 pm
Location: Easton, PA, USA

Post by zsepi »

most of the time I use this site for quick reference:
http://www.cplusplus.com/ref/
to answer your specific question, here is the documentation on printf: http://www.cplusplus.com/ref/cstdio/printf.html
though you might wanna have a look at some C tutorial...
Dealing with failure is easy: Work hard to improve.
Success is also easy to handle: You've solved the wrong problem. Work hard to improve.

hank
Experienced poster
Posts: 146
Joined: Mon Feb 04, 2002 2:00 am
Location: VCORE.

Post by hank »

You can try this code... :P
[c]
#include "stdio.h"
#include "conio.h"
void main()
{

int k ;
while( ( k=getche() )!='\n' ){
//..........
}
}
[/c]

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski »

you also may use this:

[c]
#include <stdio.h>

while((k = getchar()) != '\n')
{
/* something to do */
}
[/c]
using "conio.h" under unix is not allowed ...

Best regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

Russell John
New poster
Posts: 40
Joined: Mon Jul 21, 2003 9:21 am
Location: Planet Earth
Contact:

Post by Russell John »

Dominik Michniewski wrote: using "conio.h" under unix is not allowed ...
Thanks for the info... didn't knew that!

What to use in UNIX then? :o
1024 Programmer's Lane,
Algorithm City, United States of C++,
Planet Earth.

Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

Dominik already wrote.

conio is a Borland extension, not present in the standard, not supported by other compilers, definitely not present in gcc.

Post Reply

Return to “C”