Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

like the Object class C++

 
webmaster forum
Activity
0%
 
New Poster
Posts: 10
Topics: 5
May 23, 2010, 02:31:15 AM

i would like to create a method that receives an object as a data type and can be checked in this method if it's a sting or a vector<string> for using in different actions inside my method.

this can be done in Java using the Object Class, can i do something like that in c++


Edit: removed self promotional links. They are only allowed in signatures
« Last Edit: June 16, 2010, 10:36:03 PM by Admin »
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
May 23, 2010, 06:20:59 AM

Good question, unfortunately am not a c++ programmer so can not help. Try a quick google search, if you find the answer please post it back here for everyone to see

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
EvoD  Offline
Activity
0%
 
New Coder
Posts: 32
Topics: 4
July 20, 2010, 02:32:07 PM

Me too,
ive always been intrested in learning how to C++
 
webmaster forum
singam  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 19
August 15, 2010, 11:19:50 PM

It's as easy as that. Although these objects are all Players, they are completely independent of one another. They were created from the same template, but they can have different attributes. For example, "blueHat" might be a slow, strong player, while "greenHat" might be quick and weak, and "yellowHat" might be a well balanced individual, etc. The thing that makes these objects similar is that they all must have values for strength, health, and agility, but nothing else. They can all move, attack monsters, and get treasures, but that is all they can do. So -- they are similar in the kinds of things they can do and the attributes they must have, but they are different in that they can each have their own values for those attributes.
« Last Edit: March 17, 2011, 10:24:43 PM by Admin »
 
webmaster forum
Admin  Offline
*
 
Code Guru
Location: India
Gender: Male
Posts: 1387
Topics: 105
NaviBuster NaviBuster
WWW
August 15, 2010, 11:26:45 PM

Have you tried with template class in C++?

Is this the one that you were looking for?
 
webmaster forum
Activity
0%
 
New Coder
Posts: 15
Topics: 0
March 09, 2011, 12:33:29 PM

An object doesn't exist until an instance of the class has been created; the class is just a definition.  When the object is physically created, space for that object is allocated in RAM.  It is possible to have multiple objects created from one class.  Objects of class types that are not copy restricted can be assigned, passed as arguments to functions, and returned by functions.

dell coupons codes
 
webmaster forum
Activity
0%
 
New Coder
Posts: 18
Topics: 0
March 20, 2011, 11:21:46 PM

I was searching for this kind of info on the web for many gays!!. .

Tech Blog
 
webmaster forum
Activity
0%
 
New Coder
Posts: 17
Topics: 6
April 08, 2011, 09:28:46 PM

I accept They can all move, attack monsters, and get treasures, but that is all they can do.  So -- they are similar in the kinds of things they can do and the attributes they must have, but they are different in that they can each have their own values for those attributes.

Termination Letter
 
webmaster forum
mak14317  Offline
Activity
0%
 
Skilled Coder
Real name: Janne
Location: california
Gender: Male
Age: 26
Posts: 108
Topics: 1
WWW
May 03, 2011, 11:38:35 PM


Code:

class X {
  // members of class X
};

struct Y {
  // members of struct Y
};

union Z {
  // members of union Z
};


this is the class type to create object instance of a class...
« Last Edit: July 12, 2011, 10:48:09 PM by Admin »

herbal vaporizer
Happy vappy vaporizer
Eclipse Vape
Ivape
 
webmaster forum
john14317  Offline
Activity
0%
 
Skilled Coder
Posts: 149
Topics: 0
June 07, 2011, 05:31:51 AM

A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions.

An object is an instantiation of a class. In terms of variables, a class would be the type, and an object would be the variable.

Classes are generally declared using the keyword class, with the following format:

Code:

class class_name {
  access_specifier_1:
    member1;
  access_specifier_2:
    member2;
  ...
  } object_names;


Where class_name is a valid identifier for the class, object_names is an optional list of names for objects of this class. The body of the declaration can contain members, that can be either data or function declarations, and optionally access specifiers.
« Last Edit: July 12, 2011, 10:48:27 PM by Admin »

payday loans
instant online cash advance
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page January 08, 2012, 02:08:52 AM