Thread: what changes you would make?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Registered User
    Join Date
    Mar 2011
    Posts
    254
    Quote Originally Posted by King Mir View Post
    Code:
    class Student {
        int rollno;
        string sex;
        string name;
        float gpa;
        Date DOB;
    public:
        void prnt() const; //this is a const member function 
    };
    Thank you, King Mir.

    Please help me with some follow-on queries. Thanks.

    I see that you used the word "public", what does it do? How would it differ if it were "private" instead?

    You have used the word "const" after the function name although before this "const" used to precede anything it acts on. Okay. How would it made the function 'constant' this way?

    I see you didn't include the "read()" function in the class. Any reason?

    Thank you for the help and your time.

    Regards
    Jackson

    PS: Sorry, CornedBee, I forgot to thank you.
    Last edited by jackson6612; 09-25-2011 at 06:54 AM.
    I'm an outright beginner. Using Win XP Pro and Code::Blocks. Be nice to me, please.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-27-2011, 04:14 PM
  2. Establishing 'make clean' with GNU make
    By Jesdisciple in forum C Programming
    Replies: 9
    Last Post: 04-11-2009, 09:10 AM
  3. How would I make a c++ prgoram make a .exe file?
    By Rune Hunter in forum C++ Programming
    Replies: 9
    Last Post: 12-26-2004, 05:56 PM
  4. Make window in VB but make program in C/C++?
    By Boomba in forum Windows Programming
    Replies: 1
    Last Post: 06-23-2004, 12:29 AM
  5. Replies: 6
    Last Post: 04-20-2002, 06:35 PM