Thread: newbie questions

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    1

    newbie questions

    I have a couple of questions. Call me an idiot if you wish.

    How do I declare a real number variable in C++?

    What is a function prototype and how is it used?

    What statement do you use to get data out of a value returning function?

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    do you mean real as in positive integer?

    Code:
    unsigned int name;
    //or 
    int name;
    unsigned insures that it will not have a sign (positive)...

    >>What is a function prototype and how is it used?
    looks like this:
    Code:
    int function(int,char,float); //prototype
    ... //other stuff
    int function(int i,char a,float x) {...} //definition
    Last edited by major_small; 12-04-2003 at 01:19 PM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    real as in the set of real numbers. The datatype is float (REAL*4) or double (REAL*8).
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >What statement do you use to get data out of a value returning function?
    Simple assignment:
    Code:
    data = function();
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory handling functions (newbie questions)
    By PaulBlay in forum C Programming
    Replies: 6
    Last Post: 03-10-2009, 06:37 AM
  2. newbie questions
    By raptorx in forum C Programming
    Replies: 2
    Last Post: 10-10-2007, 09:30 PM
  3. Im a newbie to C and i have some questions
    By pave1104 in forum C Programming
    Replies: 5
    Last Post: 07-05-2006, 09:48 PM
  4. I have some newbie questions
    By Myra Mains in forum C++ Programming
    Replies: 6
    Last Post: 05-06-2002, 09:30 PM
  5. Real newbie with VC6 questions
    By MagiZedd in forum Windows Programming
    Replies: 8
    Last Post: 10-15-2001, 08:27 PM