# include - is nonstandard
#include - is nonstandard
void main() - is incorrect
ch=(char*)malloc(20) - the cast is unnecessary, you should check the return value
clrscr(); - nonstandard function
gets(ch); - never use gets()!
return 0; - returning a value from a void function?
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
||=== perm, Debug ===|
|warning: return type of 'main' is not `int'|
||=== Build finished: 0 errors, 1 warnings ===|
i wonder why your program gives me warning....
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
okay. but don't do it again.
:)
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
the entire thread, starting from the very first snippet by OP, is crap.
code snippets should not be allowed to be created by anyone with less than 100 posts.
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
I agree, this is not up to snippet level, overall.
Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185
unfortunately, the reality is that the snippet quality around here tends to be amateurish if not downright garbage.
so it actually IS "up to snippet level".
and that's the real problem
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
>> need a code somewhat like this
Too bad for you. Closed
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403