Solved

A siple c++ question again...

Posted on 1997-12-05
6
168 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
  • 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now