CrazyEngineers
  • 7th c++ Problem

    Manish Goyal

    Member

    Updated: Oct 25, 2024
    Views: 867
    see the code
    #include<iostream.h>
    #include<conio.h>
    class demo
    {
    private:
    int no;
    public:
    void get_no()
    {
    cin>>no;
    }
    void process_no() const
    {
    no=4;
    }
    void display()
    {
    cout<<no;
    }
    };
    void main()
    {
    demo c;
    c.get_no();
    c.process_no();
    c.display();
    }
    
    Can you explain me what and why for this code?

    Please don't use compiler for answering this!!!
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Manish Goyal

    MemberJan 9, 2010

    what happened guys?
    63 views but no replies..........
    should i give you the answer..?cummon guys I dont't think that this is that much tough as compared to previous problems.
    Are you sure? This action cannot be undone.
    Cancel
  • krunal_p

    MemberJan 9, 2010

    Here,

    When we use a Const symbol,
    that method becomes a Read Only Structure..


    So it will give a Compile time error.

    😉
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberJan 9, 2010

    correct ...Krunal
    and welcome to ce
    Are you sure? This action cannot be undone.
    Cancel
  • krunal_p

    MemberJan 9, 2010

    Does we have any Java related Threads..?
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberJan 9, 2010

    Yes we have java related threads like this

    #-Link-Snipped-#

    If you have any problem related to java then you can post it in appropriate section

    Procedure for posting you can get it from here

    #-Link-Snipped-#
    Are you sure? This action cannot be undone.
    Cancel
  • krunal_p

    MemberJan 9, 2010

    Thanks............😁
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberJan 9, 2010

    You are welcome krunal
    have your active participation here.I am sure you will learn a lot
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register