View Full Version : C++ Letters to Number
01-22-2012, 02:08 PM
I have this so far:
any possible way to shorten this?
01-22-2012, 02:20 PM
Make letter into a char (or just do *letter).
Go here: http://www.asciitable.com/
Subtract the ascii # with the input number. No conditionals really needed.
01-22-2012, 02:24 PM
Thanks I doubt you can do this but in C++ does a+1=b ?
01-22-2012, 03:17 PM
Yes. You can also do that in C++. But do note it has to be a char, not a string/char*.
01-22-2012, 03:20 PM
This solves the problem thanks :)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.