Click here to Skip to main content
15,886,873 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
jschell22-Dec-23 6:51
jschell22-Dec-23 6:51 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
englebart21-Dec-23 5:28
professionalenglebart21-Dec-23 5:28 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
Gerry Schmitz21-Dec-23 8:02
mveGerry Schmitz21-Dec-23 8:02 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
glennPattonWork322-Dec-23 1:16
professionalglennPattonWork322-Dec-23 1:16 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
mdblack9822-Dec-23 2:10
mdblack9822-Dec-23 2:10 
GeneralRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
Owen Lawrence22-Dec-23 5:19
Owen Lawrence22-Dec-23 5:19 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
Juan Pablo Reyes Altamirano22-Dec-23 5:49
Juan Pablo Reyes Altamirano22-Dec-23 5:49 
GeneralRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
jschell22-Dec-23 7:09
jschell22-Dec-23 7:09 
Juan Pablo Reyes Altamirano wrote:
So when C++ introduced void as a return type, even for main


That statement is some what confusing as phrased.

Presumably originally C++ allowed for no return value from main(). Thus for compilation to succeed the type would need to be void.

That was because C allowed main to exit without a return value also.

The original C recommended a return value. And so does C++. Following is from "The C++ Programming Language Special Edition" section 6.1.5

"Conventionally, main() should return zero if the program terminates normally and nonzero otherwise."

And from 3.2

"If no value is returned, the system receive a value indicating successful completion"

So it is saying that the program doesn't need to but then a default value will be returned. So it is implicit.
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
Ralf Quint22-Dec-23 7:27
Ralf Quint22-Dec-23 7:27 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
Member 1616867422-Dec-23 13:35
Member 1616867422-Dec-23 13:35 
AnswerRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
sx200826-Dec-23 19:17
sx200826-Dec-23 19:17 
GeneralRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
jschell27-Dec-23 5:59
jschell27-Dec-23 5:59 
GeneralRe: ( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ? Pin
sx200829-Dec-23 16:59
sx200829-Dec-23 16:59 
QuestionGood alternatives to STM32CubeIDE? Pin
CPallini21-Dec-23 1:03
mveCPallini21-Dec-23 1:03 
AnswerRe: Good alternatives to STM32CubeIDE? Pin
Mike Hankey21-Dec-23 3:24
mveMike Hankey21-Dec-23 3:24 
GeneralRe: Good alternatives to STM32CubeIDE? Pin
CPallini21-Dec-23 3:32
mveCPallini21-Dec-23 3:32 
GeneralRe: Good alternatives to STM32CubeIDE? Pin
honey the codewitch21-Dec-23 4:28
mvahoney the codewitch21-Dec-23 4:28 
AnswerRe: Good alternatives to STM32CubeIDE? Pin
honey the codewitch21-Dec-23 4:27
mvahoney the codewitch21-Dec-23 4:27 
GeneralRe: Good alternatives to STM32CubeIDE? Pin
CPallini21-Dec-23 7:15
mveCPallini21-Dec-23 7:15 
GeneralRe: Good alternatives to STM32CubeIDE? Pin
honey the codewitch21-Dec-23 7:16
mvahoney the codewitch21-Dec-23 7:16 
AnswerRe: Good alternatives to STM32CubeIDE? Pin
Nagy Vilmos22-Dec-23 1:52
professionalNagy Vilmos22-Dec-23 1:52 
GeneralRe: Good alternatives to STM32CubeIDE? Pin
CPallini22-Dec-23 4:14
mveCPallini22-Dec-23 4:14 
GeneralKnow Thyself Pin
Steve Raw20-Dec-23 21:00
professionalSteve Raw20-Dec-23 21:00 
GeneralRe: Know Thyself Pin
jschell21-Dec-23 4:33
jschell21-Dec-23 4:33 
GeneralRe: Know Thyself Pin
Steve Raw21-Dec-23 5:20
professionalSteve Raw21-Dec-23 5:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.