please dont rip this site

Language Ccpp Cppref Examples CLASS2.CC

/ ************************************************************************
 *
 * Purpose:
 * Author:  M J Leslie
 * Date:    26-Oct-98
 *
 ************************************************************************/


#include <stdlib.h>
#include <iostream.h>               // Instead of stdio.h

class string 
{
    public:
  
    // Constructor.

    string()
    {  
    Age=35;
    }
   
    // Destructors (Clear storage - free()).

    ~String()
    {}
    
    // ... Overloaded functions.
     
    void print()           
    { 
    cout << "Martin is " << Age << endl ; 
    }
    
    void print(char * str) 
    { 
    cout << "** " << str << " **\n"; 
    }

    private:
        
    int Age;                    // Declare Age
  
};

main()
{
    string test;    // Constructor inserted by the compiler here.
    
    test.print();
    test.print("Leslie");
}


file: /Techref/language/ccpp/cppref/examples/class2.cc, 0KB, , updated: 1998/10/27 13:33, local time: 2024/12/2 02:06,
TOP NEW HELP FIND: 
3.144.108.200:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://ecomorder.com/techref/language/ccpp/cppref/examples/class2.cc"> language ccpp cppref examples class2</A>

Did you find what you needed?

 

Welcome to ecomorder.com!

 
Quick, Easy and CHEAP! RCL-1 RS232 Level Converter in a DB9 backshell
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .