954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Correct function heading

Hi everyone, I'm new at C (just started this week), and I'm reading tutorials on line without the help of a book or class. I was wondering if there are common practices most tutorials teach that really aren't good to get into.

The tutorial I'm reading now says to use int main(), and then at the end to return 0; however, I was reading some of the code snippets on this site and found many people have other things such as main(void) or some other heading with void in it.

There was also an article I believe that said not to use scanf, but instead you should use gets (or something along those lines.)

I know my question isn't the most direct but any advice on common practices or maybe a recommended C tutorial would be great. :-) Thanks for any replies.

dsladev
Newbie Poster
14 posts since Jun 2009
Reputation Points: -3
Solved Threads: 0
 

gets()
scanf() -- read the full series
void main()

Might as well see Formatting too.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Thanks that has helped a lot.

dsladev
Newbie Poster
14 posts since Jun 2009
Reputation Points: -3
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You