int array filling

Joined
Oct 15, 2007
Messages
1
Reaction score
0
Hello, I am begginer in C++ and I have this problem:
when you declare
Code:
char test[50];
cout<<char[3];
it will display 4th letter of that char, like I enter 'tester' it displays 'e'.

Now I want to do same with int, but dont know how.
I'd like to enter number like
Code:
int test[50];
cout << test[3]
and if we enter number 50123 it will display number 2 (4th member)
test[0]=5
test[1]=0
test[2]=1
test[3]=2
test[4]=3

I need to do math functions with it then so it wont work with char i think.

can anyone help me how to do it ? Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top