Programs Experts Community Question Online Exam ResourceLink Gallery Members Search
Login
Username:
Password:
New user? Sign up
Forgot Password?
Notice
New Category Started

Question, Resource &
Rich Text Editor
for content text input
Invite Friends
Email *
Firstname *
Lastname
 
  Question by CodeZero
View Profile of CodeZero

CodeZero
int *p=10;

or

float *f=1.5;

why do these two statements throw an error on compilation??

but when we write:

char *c="ABC";
there is no error.
31st Dec 09 08:45:57 AM
  Answers by other users
View Profile of Joydeep

Joydeep
int*, char* or float* is suppose to hold a memory address, here 10 or 1.5 is not an address....

but how char* c = "ABC" works ...

for a character array it automatically sends the base address of the string, for any char array when ever u initalize it or store anything what gets stored internally is the base address of the array

8th Jan 10 03:54:39 PM
Post Asnwer
Tips: Please don't post a answer which is already their for the question.
        You can post puzzle related question along with programming questions.

 
© Scodz, 2006 All Rights Reserved. Guest Book | FAQ | Privacy Policy | Terms & Conditions | Contact Us  
Contact Us for Advertising in this website