just start the for loop at 0, like this:
for (j = 0; j < 10; j++)
cout << “Inventory Item # “ << j << “ has “ << n[j] << “ items remaining.” << endl;
Type: Posts; User: happycoder
just start the for loop at 0, like this:
for (j = 0; j < 10; j++)
cout << “Inventory Item # “ << j << “ has “ << n[j] << “ items remaining.” << endl;
if im reading you correctly, you are trying to:
1. create a new string the size of data
2. copy the contents of data to the new string
try replacing
char content[strlen(data)] = data;
if youre using C, yes. but in C++, there is no need. just saying
struct NewQ {
...
};
already defines a new type NewQ.
since 16 is decimal and 016 is octal, they will never be equal.
ah yes, i remember reading this in c by disection 2nd ed.
hey, maybe its time i polish on my basic c++
it sure did! hex literals are most suited for bitwise flags, got it!
i asked this question bec. i remember reading from my text books that an integer literal constant is always treated as a...
hi, i always initialize enum members with integer values. sometime ago, i ran accross some header files of the Qt gui toolkit. instead of integer constants, they use hex constatns.
eg.
...