Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Making "game text", et cetera  (Read 6682 times)

0 Members and 1 Guest are viewing this topic.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Making "game text", et cetera
« Reply #15 on: May 11, 2014, 07:22:37 pm »
And to zsbzsb: if you don't want to be rude, saying "you won't ever make it very far as a programmer"......

Thanks for taking what I said out of context, but Ixrec got it correct.

Quote
.....you cannot get very far as a programmer if you don't learn to debug properly.

Also on that note, Ixrec is onto it about what your problem is (I even posted a line at the end of my previous post). Vectors and most stl containers will not automatically insert elements if you ask for one that does not exist.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Making "game text", et cetera
« Reply #16 on: May 11, 2014, 08:21:10 pm »
Could you show us what the actual string is that it's supposedly wrong about?  Checking what the value of text is at the time that loop starts should be trivial.

Just a blind guess, but it almost sounds like you might be getting confused by zero-indexing.  Namely, if the string is 39 characters long then size() returns 39 and the valid indices are 0 through 38, not 1 through 39.
« Last Edit: May 11, 2014, 08:24:14 pm by Ixrec »