Output Query

When i run this program
#include <iostream>
#include <string>
using namespace std;
int main()
{
void* array [5];
cout << "Enter the array elements:" <<endl;
for(int i=0;i<=4;i++)
{
cin >> array[i];
}
for(int i=0;i<=4;i++)
{
cout << array[i] << "\n";
}
}
I get the input some integers for ex 12 45 67 89 etc i get the output like 0x12
0x45 0x67 0x89 etc.When i give some string or character the outpu comes in some hex format not in which i want.
changing void* array[5]; to int array[5]; must solve your problem!
Topic archived. No new replies allowed.