getting a string from ints

This is a discussion on getting a string from ints within the C++ Programming forums, part of the General Programming Boards category; i'm writing an othello program and at one point in the program, i need to make a string out of ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    6

    getting a string from ints

    i'm writing an othello program and at one point in the program, i need to make a string out of two ints that correspond to positions on the board. i've tried this:

    string st = "" + (char)(x+'A') + (char)(y+'1');

    when i tried to print this string out, i just got a blank line. any help would be greatly appreciated.

  2. #2
    Open to suggestions Brighteyes's Avatar
    Join Date
    Mar 2003
    Posts
    204
    This might help.
    p.s. What the alphabet would look like without q and r.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loading ints specified in a string into an array
    By Curtster in forum C Programming
    Replies: 1
    Last Post: 03-15-2009, 02:19 AM
  2. can anyone see anything wrong with this code
    By occ0708 in forum C++ Programming
    Replies: 6
    Last Post: 12-07-2004, 11:47 AM
  3. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM
  4. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 01:45 PM
  5. convert ints to string
    By Zughiaq in forum C Programming
    Replies: 2
    Last Post: 02-25-2002, 11:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21