how to get a specific class object
Posted
by
user1275129
on Stack Overflow
See other posts from Stack Overflow
or by user1275129
Published on 2012-03-26T17:12:39Z
Indexed on
2012/03/26
17:28 UTC
Read the original article
Hit count: 209
I am still quite new to class concept. I have a problem here. for example, i have a class called
class p{
int id;
p(id){
//constructor
}
}
now, i want to make instances of class p. After i have all the instances. i want to build a function get_p(pid) to return the specific class p which id=pid, how can i write this part?
I have read c++ and java class tutorials, but i cant sort this out. please help me.
© Stack Overflow or respective owner