Solved

A siple c++ question again...

Posted on 1997-12-05
6
208 Views
Last Modified: 2010-04-10
How do I implement a "record" in c++

I nead a array with elements of different types.

say  array[a:double, b:string, c:int]
0
Comment
Question by:wqclatre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1174856
struct record{
       double a;
       char *b;
       int c;
};
struct record array[100];

0
 
LVL 4

Expert Comment

by:jos010697
ID: 1174857
I apologize for the off topic reply, but please allow me
to say something to 'ozo'. I've noticed that you've supplied
quite a lot of correct and helpful answers, but would you
please be so kind to tag them as an answer, instead of
a comment? As long as a question stays unanswered, it keeps
hanging around in the question pool and can't be graded ...

sorry for the intrusion,

kind regards,

Jos aka jos@and.nl


0
 
LVL 84

Expert Comment

by:ozo
ID: 1174858
Thank you jos, but while you may judge my answers correct,
I prefer to wait to hear that the person who asked the question
has found it helpful before I officially tag them as an answer.
(I've found that sometimes, the question they really meant to ask
may be rather different from the one I correctly answer:-)
If this habit has caused inconvenience, I apologize.
Is there a particular question hanging around now that wants to be graded?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:wqclatre
ID: 1174859
Thanks!

Why as a comment??
0
 
LVL 4

Expert Comment

by:jos010697
ID: 1174860
To ozo,

it's not an inconvenience (how could it be? I'll simply
zap to the next question if I see an ansered/commented
question ;-)

I don't know about any 'open' questions at this very moment
(maybe in unix.programming?) but I simply noticed it a
couple of times; nothing too important actually, no need
to apologize.

kind regards,

Jos aka jos@and.nl

ps. Anser this one now and you'll get your points (whatever
    they're worth ;-)
0
 
LVL 84

Accepted Solution

by:
ozo earned 30 total points
ID: 1174861
struct{
        double a;
        char *b;
        int c;
} array[100];

array[0].a = 1.5;
array[0].b = "string";
array[0].c = 3;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question