Quote Originally Posted by cute_kuddi View Post
cud any1 plz plz plz
SMS speak is not so cute, cute_kuddi. Please talk like a normal person.

You have several problems in your code (since n00bs often miss this, the red words are links, click them):
  1. You said main would return an int, but you don't. Add a return 0; as the last line of main. Read up on why it matters here and here.
  2. You are reading in individual characters into the slots in b. That means entering 1234 gives you '1', '2', '3', '4' (the ASCII values), not the digits 1, 2, 3, 4.
  3. You don't even need to take user input for this to work. Actually, certain user input can cause this function to not work.
  4. You don't need to check sizeof(a), it will only make your code not work on non-32 bit machines.

Your code betrays a serious lack of understanding of how computers and the C language represent data. You need to do some serious reading on binary numbers and endianness, and some C tutorials on user IO and character/string data vs. integer data.

Out of curiosity, did you try Google: how to check endianness - Google Search