if so then why is the return type named int instead of char?
For the same reason the parameter type is int instead of char, and why getchar returns int: to support EOF. If EOF were representable by char, how would you know the difference between EOF and a legitimate character with the same value?
Suppose you created a function that takes integer type value, converting this integer value into its corresponding ascii value and displays it(using any other function/code which is within your created function).
Now whatever the function returns, it has already displayed the character before returning any values.
Then the returned value may be used to check if the putchar() worked or not.Which is why EOF is returned when writing is successful and an integer otherwise.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...