We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,371 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

C++

Answer by true or false :
a) There could be several function calls in a program. True False
b) Function call can be placed wherever it is required, regardless of the function’s number of calls. True False
c) There are no conditions on where to place a function prototype. True False
d) Functions definitions should always be placed after the main function. True** False**
e) A double variable can be pointed to by an integer pointer without loss/change of information. True False
f) An integer variable can be pointed to by an integer pointer without loss/change of information. True False
g) An integer variable can be pointed to by an integer pointer without loss/change of information. True False
h) The content of a pointer should always be an address of another normal variable. True** False**
i) The content of a pointer can be copied into another pointer of the same type without loss of information. True False
j) The & and * operators will do the same operations when they are used with pointers.True False
k) The * operator has more than one meaning which is determined by the context of usage. True False
l) Any function that is not of type void and it doesn’t use pointers, should contain a return statement. True False
m) There is no difference between call by value and call by reference in programming languages. True False

Can any1 check if my aswers are correct or no ??

3
Contributors
3
Replies
1 Day
Discussion Span
11 Months Ago
Last Updated
4
Views
Ouss
Newbie Poster
5 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

f and g are the same question.

You didn't answer h

i is ambiguous. If they mean the value of the pointer itself, then it is true. If they mean the integer to which the pointer points, then it would be true only if memory were allocated to the destination pointer or the destination pointer already points to an integer variable.

j is incorrect

Otherwise I your answers are correct

Ancient Dragon
Achieved Level 70
Team Colleague
32,145 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69

All that AD said, plus these corrections:

c) is True. A function prototype / declaration can appear anywhere (well, anywhere any other variable declaration can appear), this includes the global scope, namespace scope, class scope, function body, and even within any { } scope within the function body. At least, that's my understanding of the question, but "no conditions" is too vague (because, of course, it must appear before it is needed, so that's one condition, and then there are also obvious places where you can't put a function prototype, like within a string literal or something, but these are trivial conditions).

h) is correct.

l) This question is weird, it's the "and it doesn't use pointers" part that I don't understand. This makes no difference at all. In any case, the answer is correct, True.

mike_2000_17
21st Century Viking
Moderator
3,140 posts since Jul 2010
Reputation Points: 2,062
Solved Threads: 625
Skill Endorsements: 41

tnxXx all :))

Ouss
Newbie Poster
5 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0693 seconds using 2.72MB