LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-08-2005, 04:01 PM   #1
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Rep: Reputation: 30
return 0 or return(0) in C?


If parenthesises are required in C for functions, even without arguments then why can you use return 0; and return(0);? Which one is recommended?
 
Old 01-08-2005, 04:15 PM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
Because return isn't a function. You can choose either one, it's just a style preference.
 
Old 01-08-2005, 04:17 PM   #3
cbonar
Member
 
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Kubuntu + Debian
Posts: 53

Rep: Reputation: 15
Lightbulb

Well, return is not a function. This is a language construct. This is why many people write it without parenthesis : to clearly make the distinction.

(edit : sorry, cross-post)
 
Old 01-08-2005, 04:26 PM   #4
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
Makes sense...What exactly is a language construct though?
 
Old 01-08-2005, 04:32 PM   #5
cbonar
Member
 
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Kubuntu + Debian
Posts: 53

Rep: Reputation: 15
Quote:
Originally posted by servnov
Makes sense...What exactly is a language construct though?
"keyword", if you prefer...
 
Old 01-08-2005, 04:39 PM   #6
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
Heh. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dd return code barefootdoctor Linux - General 2 10-13-2005 12:54 PM
return value neerajchaudhari Linux - Newbie 1 08-29-2005 01:42 AM
application return value prital Linux - Newbie 1 03-30-2005 09:29 AM
return to ntfs eyedoc General 4 03-19-2005 09:23 PM
return linuxanswer Programming 4 10-25-2003 11:31 PM


All times are GMT -5. The time now is 03:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration