• Welcome to Dark Bit Factory & Gravity.
 

c++ Data?

Started by Paul, September 21, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Paul

I'm wondering how to include data in my c++ exe?

In blitz i would use the Data statement, for example:
Data 1,2,3
Data 2,4,6
Data 4,5,1
and the use
'Read ' to get the information back.
could anyone show me a quick example of how i would do this pealse :)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

va!n

#1
hi paul.... i dont know much about c/cpp, but afaik you can or simple must do it, by using an array and directly store the datas to it...


DIM aYourArray   ; i dont really know atm how to write it in C/CPP
    {
        1,2,3
        2,4,6
        4,5,1
    }



Edit, possible it must look like this:


Int aYourArray[10] = { 1, 2, 3, 2, 4, 6, 4, 5, 1 };
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Paul

thx for the quick reply. Did it this way now :)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Shockwave

Also if you want to keep your listing tidy, you can always include your arrays in with #include
Shockwave ^ Codigos
Challenge Trophies Won:

Paul

Do you mean having them in a separate file?
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won: