472,951 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 software developers and data experts.

Number for space character in C

144 100+
Hai friends....

In C

for 97=A character , 65=a charcter....can u tell what is the number for "space" character...

Davidson
Apr 5 '08 #1
8 23284
questionit
553 512MB
Hai friends....

In C

for 97=A character , 65=a charcter....can u tell what is the number for "space" character...

Davidson
Hi Davidson

Wouldn't it be a good idea if you attempt to write a little and handy C program that will give you code for any character you enter in the program?

Anyway, Ascii code for space is 32.

Good luck with the program and learning C

Qi
Apr 5 '08 #2
JosAH
11,448 Expert 8TB
Hai friends....

In C

for 97=A character , 65=a charcter....can u tell what is the number for "space" character...

Davidson
Why do you even want to know that? A space character is simply this: ' '.
Any numerical value is bound to be valid only for a certain character encoding
such as ASCII or EBCDIC; if you want to sprinkle those numerical values all
over in your code it is doomed to be tightly coupled with that one single
character encoding scheme. Better stay far away from such bad practices.

kind regards,

Jos
Apr 5 '08 #3
davidson1
144 100+
Thank u josh..questionit.....

i need about that character because...i am doing project....i want allow the user to enter only characters....ie the name...other he could not enter any thingelse

....
(eg)

raja kumar

ravi kumar

only space and character can only enter by user...that is what..

As 32 was correct...for space that was send by questionit...

i need to know what is the number for [

i need to know what is the number for ]


pl help me..

Davidson
Apr 5 '08 #4
Ganon11
3,652 Expert 2GB
You can find them out easily enough by writing a program to output '[' and ']' as integer values. Store them as a char, then (if you are working in C), use the %d specifier to print them out with printf. In C++, typecast the chars to ints before cout-ing them.

But, as Jos said, if you are writing your program to compare a character to 32 to see if it is a space, it will only work on your computer and computers with similar character codes. Instead, you can just compare it to the character literal ' ', which will get the proper character no matter what system.
Apr 5 '08 #5
Why do you even want to know that? A space character is simply this: ' '.
Any numerical value is bound to be valid only for a certain character encoding
such as ASCII or EBCDIC; if you want to sprinkle those numerical values all
over in your code it is doomed to be tightly coupled with that one single
character encoding scheme. Better stay far away from such bad practices.

kind regards,

Jos
how should i do it for carriage return?
Apr 5 '08 #6
Ganon11
3,652 Expert 2GB
A carriage return character is '\r', and a newline character is '\n'.
Apr 5 '08 #7
davidson1
144 100+
Thank u friends...

do u know any website.........which contain all the numbers for charcters..........

pleas send that website.........

it will be useful to be.................

Davidson
Apr 5 '08 #8
Laharl
849 Expert 512MB
There's ASCII tables all over the internet, www.ascitable.com is one, as for EBCDIC, just Google it.
Apr 5 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: mr_burns | last post by:
Hi, I am tryin to format a number from, for example, 1 to '01'. How is this done? Cheers Burnsy
12
by: levent | last post by:
What is an elegant way (using std::stream's) to extract number of white-space separated entries in a given line of a formatted text file? e.g.: Take this section of a file, 1 2.78 4 5 -0.003...
4
by: Vig | last post by:
Is scanf or any other function capable of reading numbers in the format 1.2345d-13 where 'd' serves the same role as 'e' usually does in scientific notation? This operation is iterated through...
13
by: fool | last post by:
Dear group, I want to check if the given string is a number. If any value is inputed other than a number then error. The following is not the correct solution. Can some one tell me any link for...
9
by: Nathan Sokalski | last post by:
I have several TextBoxes with TextMode="MultiLine" in which I want to limit the number of characters that can be entered using a RegularExpressionValidator. I have come up with the following...
4
by: walterbyrd | last post by:
I don't know exactly what the first non-space character is. I know the first non-space character will be * or an alphanumeric character.
3
by: sunmat | last post by:
To find number of character without space using java Example: String = prabu sun No. of char =8 plz send me code
23
by: neha_chhatre | last post by:
which is the best format specifier(data type) if i have to work with decimal number. also please tell me the syntax for truncating a decimal number please reply as soon as possible
1
by: Brock | last post by:
Thanks in advance... I have a string that I'm building that needs to write to a file the last name, first name and middle initial in this format with a maximum of 20 characters. Two examples: ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.