Author Topic: Newbie that need some understanding void int  (Read 8523 times)

snowfiring

  • Guest
Newbie that need some understanding void int
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7789
    • My Best Post
Re: Newbie that need some understanding void int
« Reply #1 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

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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Newbie that need some understanding void int
« Reply #2 on: May 10, 2013, 09:25:35 am »
Topic locked, as it violates our forum rules (as stated by Tim).