1

I was trying to solve https://www.spoj.com/problems/STRHH/ As a part of my solution, I wanted to have variables like word1, word2, word3 and so on till wordt.

I can do it easily using loops, but what syntax do I need in order to initialise variables following this specific pattern? Specifically, where do I mention index number in my variable?

user185887
  • 643
  • 6
  • 18
  • 4
    Sounds like a good time to learn about [arrays](http://www.cplusplus.com/doc/tutorial/arrays/). – Blaze Jul 17 '19 at 08:00
  • 8
    Simple arrays or (if the amount is unknown) vectors? I'd say it's time to [get a couple of good books](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list/388282#388282) and learn C++ *properly*. – Some programmer dude Jul 17 '19 at 08:01

0 Answers0