Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


String -> Char/SmallInt?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Mon Feb 25, 2008 10:05 pm    Post subject: String -> Char/SmallInt? Reply with quote

Is there any way to convert a string to a char/small integer?
Like atoi or strtoul, but for char/smallint.
If not, is there some type of casting to be done?

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Tue Feb 26, 2008 6:02 am    Post subject: Reply with quote

uhhh, what language, kind of important info, duh!
_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Feb 26, 2008 7:00 am    Post subject: Reply with quote

No, because the string might contain more than 1 char.
If you want, you can check the first character, string[0] or check if the string length is 1, but in this case its easier to just get a single character instead of a string.

What exacly are you trying to do?
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Tue Feb 26, 2008 7:40 am    Post subject: Reply with quote

Snootae wrote:
uhhh, what language, kind of important info, duh!
It'd obvious if you knew what atoi and strtoul were.
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Tue Feb 26, 2008 9:02 pm    Post subject: Reply with quote

Symbol wrote:
No, because the string might contain more than 1 char.
If you want, you can check the first character, string[0] or check if the string length is 1, but in this case its easier to just get a single character instead of a string.

What exacly are you trying to do?

So? What happens if there is more than an int in your string for atoi? It doesn't matter. I can check return values or use a loop, etc.
And you don't get what I mean-- I don't mean char as in a letter. I mean the numeric data type char (because an unsigned char is kinda what we know as a byte).
Like, converting the string "0xFF" to the unsigned char value 0xFF.

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Wed Feb 27, 2008 2:36 am    Post subject: Reply with quote

Thanks.
_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Wed Feb 27, 2008 4:59 am    Post subject: Reply with quote

Snootae wrote:
uhhh, what language, kind of important info, duh!


lol, no it's not.

you can give general example and he can understand the point.
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Wed Feb 27, 2008 5:01 am    Post subject: Reply with quote

Quote:
It'd obvious if you knew what atoi and strtoul were


ahh, fair enough, just though it might help someone else who knew

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites