Search:
Forum
General C++ Programming
what is the best way to put a letter int
what is the best way to put a letter into an array
Jun 3, 2009 at 1:24am UTC
Parrish666
(10)
I am wondering what is the best way to put letters (a-z) into an array or a vector, instead of forcing the letter into the array manually. I would like to use a for loop to do so. Here is what I got:
1
2
3
4
5
vector<
char
>aplha(26);
for
(
int
x=0; x<aplha.size();x++) { }
I was thinking about
aplha[x]=
but I am not sure what to make it equal to in the loop.
Jun 3, 2009 at 1:38am UTC
helios
(17607)
'a'+x
Jun 3, 2009 at 1:46am UTC
Parrish666
(10)
thank you, that helped. i was also using functions as well. so that made it a little harder.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs