473,769 Members | 4,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Number for space character in C

144 New Member
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 23353
questionit
553 Contributor
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 Recognized Expert MVP
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 New Member
Thank u josh..questioni t.....

i need about that character because...i am doing project....i want allow the user to enter only characters....i e 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 Recognized Expert Specialist
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
aidomarogu
2 New Member
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 Recognized Expert Specialist
A carriage return character is '\r', and a newline character is '\n'.
Apr 5 '08 #7
davidson1
144 New Member
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 Recognized Expert Contributor
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
2150
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
2400
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 <tab> 7.1d5 9 40 <tab> 2.e5 -10 ....
4
2280
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 several times and we really would like not to have to read it as a string first or anything like that. Thanks -- Vig
13
1800
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 the above task? Pls just don't give the code. Thanks. #include<stdio.h> #include<stdlib.h> int main(void) {
9
3929
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 ValidationExpression: {0,250} The only problem with this ValidationExpression is that it does not include the \n character as stated on the following documentation page:
4
1969
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
4499
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
9794
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
1824
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: Brenda J Lanier Lanier,Brenda J ' note that this name is only 15 characters, with the space and comma, after formatting so I'm safe
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9849
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7393
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.