Give the output of the following program
main()
{char *p='a';
int *i=100/*p;
}
what will be the value of *i= 1
Answers were Sorted based on User's Feedback
Answer / satish
int *i=100/*p;
here in this line /*p is like starting a comment so it shuld
terminate ....
so answer is error ...
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / srinivasa. p
No,
It should give error.
1. char* not suppose to assign character.
2. and int *..assign to reference or allocate memory.
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / mishra
Its showing error on first line in HPUX.
char *p='a';
Error:-
======
error 1522: Cannot initialize a pointer with an integer
constant other than zero.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / jeetu
To add with Mr. Mishra's answer.
int *i=100/*p;
=========
Error 1 error C2440: 'initializing' : cannot
convert from 'int' to 'int *'
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ashwin
it should be an error.
int *i does not have semicolon at end since /*p is a
comment beginn'.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anita sachdeva
yes,
*p='a'
*i=100/*p i.e. 100/97
=1
hence *i=1
| Is This Answer Correct ? | 1 Yes | 4 No |
What are the components of stl?
Distinguish between: a) Normal layout & Print Layout views b) Windows Clipboard & office Clipboard c) Save & Save As Commands d) Program File & Data File e) Pie Charts & Barr Charts
What two types of containers does the stl provide?
a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.
Why should a c++ programmer be interested in stl?
How is stl different from c++ standard library?
why we are using the fork command?.. how it works?
what is compiler?
write a program that input four digit number and find how many 7 that number contains
What is stl language?
what is strcture i++ i ++i answer to this i=5 what is the out put
Is string part of stl?