| | |
Anyone have a good programes..? PlZ
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
•
•
you will have to be a tad bit more specific because there are millions of programs.:mrgreen:
Here's a program for you:
c Syntax (Toggle Plain Text)
#include <stdio.h> int main() { return 0; }
I'm joking as you might have noticed :mrgreen:
Ancient Dragon is right, what do you want and what have you made so far?
Niek
Last edited by niek_e; Jan 23rd, 2007 at 11:20 am.
•
•
•
•
I see nothing wrong with his main() -- argc and argv parameters are optional.
But let's be serious and remember that the chances of either of those causing a problem are vanishingly small.
It's hard to be humble when you're as gifted as I am at pretending to be an expert.
In C, when a function defination or declaration is followed by an empty pair of parentheses it means that zero or more parameters. So
Whereas in C++ when a function defination or declaration is followed by an empty pair of parentheses it means it does not take any argument i.e.
main when written as int main( ) in C can stand for int main( int, int, int ) or int main( void, void ) or whatever, whereas the standard specifically says that the prototype of main can only be either int main( void ) or int main( int argc, char** argv ). Hence the explicit void is required in case of pure C programs.Whereas in C++ when a function defination or declaration is followed by an empty pair of parentheses it means it does not take any argument i.e.
void. Hence the void can be safely omitted in C++. I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
An extract from Google Groups:
•
•
•
•
A C program is not required to work right if its main function does not have one of these two types:
int main(void) { /*...*/ }
int main(int argc, char **argv) { /*...*/ }
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Other Threads in the C Forum
- Previous Thread: Alignment printing with a (float)mat[][]
- Next Thread: Passing pointer address... Doubt!!!!
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks bash binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h






