Arguments

This is a discussion on Arguments within the C++ Programming forums, part of the General Programming Boards category; Hi, i'm new to c++. I understand the idea of functions, and i know that i have to declare them ...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    12

    Arguments

    Hi, i'm new to c++. I understand the idea of functions, and i know that i have to declare them as rand. I think that you have to declare an argument, but i find the tutorial a little hazy. At the minute i am experimenting with the example on the switch/case page, which i have to declare playgame, loadgame and playmultiplayer as functions. I have declared them as rand's but it says it takes 0 argument, so i don't know what to type. Any advice?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,712
    Quote Originally Posted by ftball22
    I understand the idea of functions, and i know that i have to declare them as rand.
    What do you mean by "declare them as rand"?

    Quote Originally Posted by ftball22
    I think that you have to declare an argument, but i find the tutorial a little hazy. At the minute i am experimenting with the example on the switch/case page, which i have to declare playgame, loadgame and playmultiplayer as functions. I have declared them as rand's but it says it takes 0 argument, so i don't know what to type. Any advice?
    What is your current code? Post it in [code][/code] bbcode tags.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    12
    if you have a look at functions in the C++ tutorial, there it describes the functions as rand. I would show you the code, but I'm on the family computer and not my laptop, which is where the program is. I'll post it on in the morning, if you wouldn't mind look then.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,712
    Quote Originally Posted by ftball22
    if you have a look at functions in the C++ tutorial, there it describes the functions as rand.
    Looking at the tutorial on functions, I see that rand is cited as an example of a function, but the tutorial certainly does not describe "the functions as rand".
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 03:27 PM
  2. command line arguments
    By vurentjie in forum C Programming
    Replies: 3
    Last Post: 06-22-2008, 06:46 AM
  3. Replies: 10
    Last Post: 09-27-2005, 12:49 PM
  4. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 10:48 AM
  5. registry, services & command line arguments.. ?
    By BrianK in forum Windows Programming
    Replies: 3
    Last Post: 03-04-2003, 01:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21