7th c++ Problem

Manish Goyal

Manish Goyal

@manish-r2Hoep Oct 25, 2024
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!!!

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Jan 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.
  • krunal_p

    krunal_p

    @krunal-p-76ClJw Jan 9, 2010

    Here,

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


    So it will give a Compile time error.

    😉
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Jan 9, 2010

    correct ...Krunal
    and welcome to ce
  • krunal_p

    krunal_p

    @krunal-p-76ClJw Jan 9, 2010

    Does we have any Java related Threads..?
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Jan 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-#
  • krunal_p

    krunal_p

    @krunal-p-76ClJw Jan 9, 2010

    Thanks............😁
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Jan 9, 2010

    You are welcome krunal
    have your active participation here.I am sure you will learn a lot