classs and function in c++

use of classs , struct and function to write a programme

Page 1 of 1

4 Replies - 517 Views - Last Post: 13 July 2008 - 10:40 PM Rate Topic: -----

#1 oluem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-July 08

classs and function in c++

Post icon  Posted 13 July 2008 - 01:43 AM

698725
Is This A Good Question/Topic? 0
  • +

Replies To: classs and function in c++

#2 red_4900  Icon User is offline

  • Code T(h)inkers
  • member icon

Reputation: 21
  • View blog
  • Posts: 1,120
  • Joined: 22-February 08

Re: classs and function in c++

Posted 13 July 2008 - 01:55 AM

well..

[rules][/rules]

:)
Was This Post Helpful? 0
  • +
  • -

#3 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1382
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Re: classs and function in c++

Posted 13 July 2008 - 07:48 AM

828546
Was This Post Helpful? 0
  • +
  • -

#4 polymath  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Re: classs and function in c++

Posted 13 July 2008 - 05:38 PM

WHAT?

You can put a function in a class like:
class learn {
   public:
      static return_type function_name (args) {
         //Function_code
      }
}


Then call it like this:
learn::function_name(args);



OR...

If you use objects you can do it like this:
class learn {
   public:
      return_type function_name (args) {
         //Function_code
      }
}


And then call it like this:
learn obj;
obj.function_name(args);


This post has been edited by polymath: 13 July 2008 - 05:46 PM

Was This Post Helpful? 0
  • +
  • -

#5 Einherjar  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 73
  • Joined: 10-February 08

Re: classs and function in c++

Posted 13 July 2008 - 10:40 PM

Class only has two s's's's's's
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1