cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Is any variable or container in c which
Is any variable or container in c which contain more than one data type
May 14, 2011 at 12:56pm UTC
chaman
(6)
Is any variable or container in c which contain more than one data type. vector, map etc contain only one data type but how more than one data type, if no nay then how it will solve
May 14, 2011 at 1:42pm UTC
Moschops
(7244)
There are many ways to do this.
You could put all the data you want into a structure.
1
2
3
4
5
6
struct
data {
int
a;
float
b;
char
* z; }
then make a container of those structs
vector<data> newVector;
May 14, 2011 at 1:43pm UTC
hamsterman
(4538)
See polymorphism.
May 14, 2011 at 1:45pm UTC
Moschops
(7244)
Did I horrifically misunderstand the question there? Oops. :)
Topic archived. No new replies allowed.