Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Some really newbie C++ questions...

I've recently started learning C++ as an addition 2 Visual Basic 6. I don't know much about C++ at all.

Can you make indexed variables? (ie. in VB6 code it would look like this "Private MyInteger(9) as Integer" that makes 10 MyIntegers.) & how do I structure variables? I usually try 2 program games, so I need indexed structured variables alot.

What's wt the "#Include"? I downloaded a C++ compiler that has lots of .h files. Do I have 2 copy all the .h files that I want into the folder of my game?

Functions. In VB6, if you want alot of variables changed, you can do this.
[code]
Call ChangeTheseVariables(a, b, c)
[/code]
Which could change the variables & return them 2 new values. Can you do something like that in C++? I don't want 2 always have 2 do this.
[code]
a = ChangeVariableA;
b = ChangeVariableB;
c = ChangeVariableC;
[/code]

Thanks!
[b][red]Dragon[/red][purple]storM[/purple][/b]

Comments

  • AcesOverAcesOver Member Posts: 267
    Your qusetions are general C++ / and would be more approriate in a different form however see comments.

    : Can you make indexed variables? (ie. in VB6 code it would look like this "Private MyInteger(9) as Integer" that makes 10 MyIntegers.) & how do I structure variables? I usually try 2 program games, so I need indexed structured variables alot.

    int MyInteger[10];
    this creates an array of 10 ints. To accessfirst var you would do this
    MyInteger[0]...and last element is MyInteger[9];

    : What's wt the "#Include"? I downloaded a C++ compiler that has lots of .h files. Do I have 2 copy all the .h files that I want into the folder of my game?

    No...the compiler will no where they are and handle it.
    :
    : Functions. In VB6, if you want alot of variables changed, you can do this.
    : [code]
    : Call ChangeTheseVariables(a, b, c)
    : [/code]
    : Which could change the variables & return them 2 new values. Can you do something like that in C++? I don't want 2 always have 2 do this.
    : [code]
    : a = ChangeVariableA;
    : b = ChangeVariableB;
    : c = ChangeVariableC;
    : [/code]

    You would have to write a function to do it, but I have a hard time sseing why?
    :
    : Thanks!
    : [b][red]Dragon[/red][purple]storM[/purple][/b]
    :

Sign In or Register to comment.