Mail Archives: djgpp/2000/02/14/23:52:06
sort of . . .
This doesn't work, granted there may be some problems to it, but I keep getting
errors I have no clue what to do with.
Here's the program:
#include <iostream.h>
#include <vector.h>
#include <stdlib.h>
int main()
{
vector<char> word(10); //ten letter word
int k; //counter
char letter; //no need
while(cin>>letter) //input letter by letter . . . one step at a time
{
word[k]=letter; //puts the letter in the current index of the vector
k++; //increases counter
}
cout<<word<<endl; //SHOULD OUTPUT THE VECTOR
EXIT_SUCCESS; //stdlib.h
}
I compile using the gxx command at the dos prompt . . . won't work any other
way, and get a whole lot of iostream errors. there are too many and they are
too long to try and make sense of. My "hello world"1 programs work with no
problems. This is just a small test . . . numbers don't work either.
- Raw text -