int error ?

hi guys;

my have a problem do you help me ?

error screenshot
http://img35.imageshack.us/img35/4062/x0ua.png



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;


int main(){

char isim[20];
char soyisim[20];
int yas[20];

cout << "Adiniz ?\n";
cin >> isim;

cout << "Soyisim ?\n";
cin >> soyisim;

cout << "Yasiniz ?\n";
cin >> yas;

cout << isim << soyisim << yas;

return 0;

}


Thanks
You've declared yas as an array of ints. So yas on its own is a pointer to the start of the array. It is not an lvalue, which means you can't change its value. You can do this with char arrays, because cin treats a char * differently from any other pointer type.

If you want the user to input the values of the array, you'll need to cin each element in turn.
Last edited on
MikeyBoy Thanks Man
You're welcome :)
Topic archived. No new replies allowed.