| | |
Few problems in char and pointers.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2005
Posts: 15
Reputation:
Solved Threads: 0
I am using borland C++ compiler ver-3.0 for running C & in that range of char type is -127 to 127.
Q1 In C, characters have ASCII codes in range 0-255. How can we print characters having ASCII code from 128-255.
printf("%c",(unsigned)129); //it will still print the char having ASCII -127
Q2 ASCII char range is 0-255,then where do the characters having -127 to 0 ASCII code come from.
Q3 Where r the local & global static variables stored.
Q4 I read that const variables r stored in rom. How cum bcoz as far as i know rom can be programmed only by hardware means.
Q5 Q6 Q7
Q1 In C, characters have ASCII codes in range 0-255. How can we print characters having ASCII code from 128-255.
printf("%c",(unsigned)129); //it will still print the char having ASCII -127
Q2 ASCII char range is 0-255,then where do the characters having -127 to 0 ASCII code come from.
Q3 Where r the local & global static variables stored.
Q4 I read that const variables r stored in rom. How cum bcoz as far as i know rom can be programmed only by hardware means.
Q5
C++ Syntax (Toggle Plain Text)
int a=9999; float *p=(float *)&a; printf("%f",*p); //output is 0.000000 why?
C++ Syntax (Toggle Plain Text)
printf("%d%d",10ul,10); //output is 100 why?
C++ Syntax (Toggle Plain Text)
float f=10.67; int *p=(int *)&f; printf("%d",*p); //output is -18350 why?
•
•
•
•
Originally Posted by akshayabc
Q1 In C, characters have ASCII codes in range 0-255. How can we print characters having ASCII code from 128-255.
printf("%c",(unsigned)129); //it will still print the char having ASCII -127
•
•
•
•
Originally Posted by akshayabc
Q2 ASCII char range is 0-255,then where do the characters having -127 to 0 ASCII code come from.
•
•
•
•
Originally Posted by akshayabc
Q3 Where r the local & global static variables stored.
•
•
•
•
Originally Posted by akshayabc
Q4 I read that const variables r stored in rom. How cum bcoz as far as i know rom can be programmed only by hardware means.
•
•
•
•
Originally Posted by akshayabc
Q5C++ Syntax (Toggle Plain Text)
int a=9999; float *p=(float *)&a; printf("%f",*p); //output is 0.000000 why?
•
•
•
•
Originally Posted by akshayabc
Q6C++ Syntax (Toggle Plain Text)
printf("%d%d",10ul,10); //output is 100 why?
•
•
•
•
Originally Posted by akshayabc
Q7C++ Syntax (Toggle Plain Text)
float f=10.67; int *p=(int *)&f; printf("%d",*p); //output is -18350 why?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- Purpose of Pointers? (C++)
- One line of code copy char array using pointers (C++)
- How to see if one string is less than another string (C)
- AnsiString Template Data Return Problem Builder 6 (C++)
- Array with names (C)
Other Threads in the C++ Forum
- Previous Thread: C++ char array parsing-Help
- Next Thread: Please some one help me in this code
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






