Random Homebrew: SensitivePSP
-a clone of a C64 version of the classic puzzle game sensitive
-60 levels in total

[Tutorial] Introduction to programming using C (III)

Discuss about your favorite (gaming...or not) devices here. The most popular ones will end up getting their own categories
Programming discussions for your favorite Device

Re: [Tutorial] Introduction to programming using C (III)

Postby m0skit0 » Wed Jan 11, 2012 11:12 pm

Advertising
C standard allows to choose from

Code: Select all
int main()
int main(int argc, char* argv[])

Anything not this (or equivalent, like int main(void)) is not standard.

ANSI C source
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4800
Joined: Mon Sep 27, 2010 6:01 pm

Re: [Tutorial] Introduction to programming using C (III)

Postby nisarg_kolhe » Mon Jan 16, 2012 5:53 am

Advertising
failbit wrote:It doesn't make a big difference but if you are programming for an OS you should always use int main. void main is mostly used when you are programming a microcontroller which has no OS so a return value would be useless.

So basically return value is a must for programming for an OS right?
ultimakillz wrote:we've had this discussion before, but maybe this article will explain it better:
http://www.gidnetwork.com/b-66.html

Yeah, the article cleared my doubts thanks! :3 And also I didn't find it anywhere else discussed, nevermind :?
m0skit0 wrote:C standard allows to choose from

Code: Select all
int main()
int main(int argc, char* argv[])

Anything not this (or equivalent, like int main(void)) is not standard.

ANSI C source

What I got was just that void is just not in standard and according to to ultimakillz article its harmful to use too! BTW thanks guys! :)
Imageand lover!
Reality Sucks! :|
!~My Blog~!
Spoiler
User avatar
nisarg_kolhe
 
Posts: 2640
Joined: Fri Dec 10, 2010 12:44 pm
Location: 404 : Not Found

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

Friends

Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita