473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

int i ='abcd';

int i ='abcd';
how exactly it works?

Njoy,
Shaan.

Aug 25 '06 #1
3 3033
shaanxxx wrote:
int i ='abcd';
how exactly it works?
I'm not sure what you're asking but if you want
to know what the meaning of 'abcd' is then it is
implementation defined because it contains more
than 1 characters. So you need to check the
documentation for your C compiler and the answer
might be different for other compilers.

Spiros Bousbouras

Aug 25 '06 #2

shaanxxx wrote:
int i ='abcd';
how exactly it works?

Njoy,
Shaan.
See the following:

ANSI C99 6.4.4.4 Character constants:
An integer character constant has type int. The value of an integer
character constant
containing a single character that maps to a single-byte execution
character is the
numerical value of the representation of the mapped character
interpreted as an integer.
The value of an integer character constant containing more than one
character (e.g.,
'ab'), or containing a character or escape sequence that does not map
to a single-byte
execution character, is implementation-defined. If an integer
character constant contains
a single character or escape sequence, its value is the one that
results when an object with type char whose value is that of the single
character or escape sequence is converted to type int.

;-p

Aug 27 '06 #3

Cong Wang wrote:
shaanxxx wrote:
int i ='abcd';
how exactly it works?

Njoy,
Shaan.

See the following:

ANSI C99 6.4.4.4 Character constants:
An integer character constant has type int. The value of an integer
character constant
containing a single character that maps to a single-byte execution
character is the
numerical value of the representation of the mapped character
interpreted as an integer.
The value of an integer character constant containing more than one
character (e.g.,
'ab'), or containing a character or escape sequence that does not map
to a single-byte
execution character, is implementation-defined. If an integer
character constant contains
a single character or escape sequence, its value is the one that
results when an object with type char whose value is that of the single
character or escape sequence is converted to type int.

;-p
thanks

Aug 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: xuatla | last post by:
Hi, I want to compare two strings regardless of the lowercase or uppercase. For example, "txt" same as "TXT", "Txt", ... I know that there's stricmp in some c++ that can perform a lowercase...
3
by: Amir Hadi | last post by:
Hi @ all I am new in programming C under GNU/Linux I want to ask you, is there any md5 solution in C under Linux? If yes, can you give me some pages with informations about md5 in C? I allready...
12
by: ranjeet.gupta | last post by:
Dear All we all are familiar with the calloc and malloc, Now we know that calloc does the initialisation which is not achived in the malloc while allocatings bytes for diffrent data types. ...
83
by: rahul8143 | last post by:
hello, what is difference between sizeof("abcd") and strlen("abcd")? why both functions gives different output when applied to same string "abcd". I tried following example for that. #include...
6
by: abcd | last post by:
I am using simple ASP.NET page using C#.NET I have developed ABCD.aspx page and ABCD.aspx.cs when I compiled it has creatred ABCD.dll in my Bin directory. Now I want to deply this to...
5
by: bryan | last post by:
If I understand correctly, I can write a custom handler for a given extension (say .abcd files) by writing a class that implements the IHttpHandler interface and then registering it in my web...
8
by: shanakard | last post by:
I m a beginner programmer and new to this site so i m not quite sure whether this is the correct place to ask this question. I saw the 2 articles published here about this question but can't seem...
5
by: st33chen | last post by:
hi, all if i have 2 tables : table1 (stocks) stk_no stk_date stk_qty ------ -------- ------- abcd 20081101 10 abcd 20081115 20
1
by: raamay | last post by:
i have a table with coulmns as C1, C2, C3, C4 which contains datas like A, B, C & D. Now how should i select records where the data is A in any one of this column. I mean i want to select records...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...

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.