Hi
Given 4 contiguous bites, how the computer know if that is an ASCII character or integer value?
Thanks
mauro21pl 10 Junior Poster in Training
Recommended Answers
Jump to Post> how the computer know if that is an ASCII character or integer value?
It doesn't.
That's for you (as a programmer) to decide, based on how you try and use that data.
Jump to PostA char is just a small integer in C.
char c = 'a'; printf( "%d\n", c );
will print the numeric value of the small int, even though it would seem to be more appropriate to print it using %c
Likewise
unsigned char c = …
All 7 Replies
Hamrick 150 Posting Whiz
Salem 5,265 Posting Sage
TheGathering 12 Junior Poster
mauro21pl 10 Junior Poster in Training
Salem 5,265 Posting Sage
Hamrick 150 Posting Whiz
Bench 212 Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.