Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 11-05-2009
Member
 
Join Date: Apr 2009
Posts: 47
Making an entire class private

hi,
I am currently in the process of coding a function that uses a class.Let me explain in detail...
Code:
  CalculateValue  int ();
This function uses a class that I coded, therefore it instantiate class, method that are used etc.. But now I want my function "CalculateValue' can not be access by variable from outsite of class.

Is this possible?
Reply With Quote
  #2  
Old 11-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Making an entire class private

Much better: if you implement your function in a cpp file and you can implements the class in that file (no header or anything else for this class :
Code:
private class 
  ( 
  public: 
private int () 
  ( 
  Return 42; 
  ) 
  / / Etc ... 
  );
Like that, your function can be accessible in this class only and it will not possible for anything else to have the class definition.
This is called an implementation.
Reply With Quote
  #3  
Old 11-05-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Making an entire class private

1. -Create a new application in C++

2. -Add the following code about
your class:

Code:
class addressC {
       //
       private:
        //
        string abs;
        string SSS;
        string fff;
        //
       public:
        addressC( string absS, string  SSSS, string  fffS); // constructor
        ~addressC(); // destructor
        void PROCView();
      };
3. -Then give the code for the procedures or functions used in that
class.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Making an entire class private"
Thread Thread Starter Forum Replies Last Post
Need help on making the main class use the module for Theatre reservation program Deshawn Software Development 11 22-03-2012 10:58 PM
Upgrade Sony Ericsson Xperia Play Micro SD card from class 2 8GB to class 4 32GB Aaryan2011 Portable Devices 8 08-10-2011 11:06 PM
Making threads private will encourage users to register the forum or not? Katherina Technology & Internet 4 08-08-2011 09:31 AM
Excel workbook is not stored in printer while printing an entire book in private area of printer Sabastiaan Windows Software 5 16-03-2010 04:51 AM
Good news for CBSE CLASS X & CLASS IX - visit learnnext surya_expert Education Career and Job Discussions 0 13-12-2008 12:09 PM


All times are GMT +5.5. The time now is 09:43 PM.