Author Topic: c++ Data?  (Read 3375 times)

0 Members and 1 Guest are viewing this topic.

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
c++ Data?
« on: September 21, 2007 »
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:

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: c++ Data?
« Reply #1 on: September 21, 2007 »
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...

Code: [Select]
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:

Code: [Select]
Int aYourArray[10] = { 1, 2, 3, 2, 4, 6, 4, 5, 1 };
« Last Edit: September 21, 2007 by va!n »
- 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:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: c++ Data?
« Reply #2 on: September 21, 2007 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: c++ Data?
« Reply #3 on: September 21, 2007 »
Also if you want to keep your listing tidy, you can always include your arrays in with #include
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: c++ Data?
« Reply #4 on: September 21, 2007 »
Do you mean having them in a separate file?
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: c++ Data?
« Reply #5 on: September 21, 2007 »
Yep :)
Shockwave ^ Codigos
Challenge Trophies Won: