help with string/char array (newb)
i am trying to make a very basic c++ program, using msvc++ 6
for my program i need the user to input a string, which is an array of characters right? ( am using an arrya of char now instead of strin since doing this with a string is more complicated apparently?) well i need to be able to pick out specific characters of what the user writes
Code:
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int main()
{
char input[100];
cout << "Input a word or phrase" << endl;
cin >> input;
cout << "test: " << input[3];
return (0);
}
lets say for input i put "abc" i want to write out c which is the third char of input.
whats happeneing is its prinitng out NOTHING, it has test: (blank)
what am i doing wrong?