Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: snowfiring on May 10, 2013, 05:47:27 am

Title: Newbie that need some understanding void int
Post by: snowfiring on May 10, 2013, 05:47:27 am
Well here im using a basic prototype in a header file and the old function from the course im taking told me to use
Code
void WriteAnswer(int x);
I had originally used
Code
int WriteAnswer(int x);
and it had worked but then was told to use void but it never really explained the difference and im wondering why i would use void over int.
Title: Re: Newbie that need some understanding void int
Post by: stahta01 on May 10, 2013, 06:55:25 am
Well here im using a basic prototype in a header file and the old function from the course im taking told me to use
Code
void WriteAnswer(int x);
I had originally used
Code
int WriteAnswer(int x);
and it had worked but then was told to use void but it never really explained the difference and im wondering why i would use void over int.

Please post your C/C++ programming questions on a website that supports programming in C or C++.

From
http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)

Quote
1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.

Tim S.
Title: Re: Newbie that need some understanding void int
Post by: Jenna on May 10, 2013, 09:25:35 am
Topic locked, as it violates our forum rules (as stated by Tim).