I'm a first year student and I study Computer Game Development.
Right now we are learning C++ among other things.
Is there a way to store numbers (int) into an array using something like cin.getline or getline(cin,x) for char arrays.
while typing I want to only separate the numbers with space.
Alternatively I could use a line like:
if(//case 'a' pressed)
goto y;
Computer Game Development
Enjoy your shitty hours and your contributions to the downward spiral of Gaming since the 1990s
Name:
Anonymous2009-10-16 19:24
instead of reinventing the wheel with lowlevel functionality such as 'cin' and friends, take advantage of the standard posix utilities, c++'s static typing and the preprocessor
main.cpp:
#include <cstdio>
#include "numbers.inc"
#define LENGTH sizeof(numbers)/sizeof(int)
int main() { for (int i=0;i<LENGTH;i++) printf("%dth number is: %d\n", i, numbers[i]); return 0; }
example use:
Administrator@pc-001 ~/test
$ ./awk.sh
1 2 3 4
23 8945 67453
0th number is: 1
1th number is: 2
2th number is: 3
3th number is: 4
4th number is: 23
5th number is: 8945
6th number is: 67453
>>22
i refuse to believe that programmers who are only interested in writing gaymans are real.
maybe i am in denial, but it is too horrible to believe that such people exist , especially on /prog/.
but it is too horrible to believe that such people exist
I find it difficult to believe that people don't care enough about English to capitalize their Is, but there you go.
Name:
Anonymous2009-10-19 19:50
>>25
hahahahahaha.
grammar faggots, in MY /prog/?
get back to gaia you pathetic SOB.