Join Our Email Alerts-Subscribe
Important Note:Login & Check Your Email Inbox and Activate Confirmation Link



Enter Your Email :

Copyright Disclaimer:
Section 107 of the Copyright Act Fair Use Contents .
We are forwarding content link(s) from our website to content website & We are not serving any contents.
Main Source:Google.com.All the Content PDF link(s) is/are obtained from GoogleSearch
for the purpose of Education & Teaching Intention. Not for commercial purpose.
Technicalsymposium.com is not liable/responsible for any copyright issues.

Placement Materials & Answers-Free Download


Software Companies Placement Papers With Answers- Alcatel Lucent-Free Download

3.1: Why doesn't the code "a[i] = i++;" work?

A: The variable i is both referenced and modified in the same expression.

3.2: Under my compiler, the code "int i = 7; printf("%d\n", i++ * i++);" prints 49. Regardless of the order of evaluation, shouldn't it print 56?

A: The operations implied by the postincrement and postdecrement operators ++ and -- are performed at some time after the operand's former values are yielded and before the end of the expression, but not necessarily immediately after, or before other parts of the expression are evaluated.

3.3: What should the code "int i = 3; i = i++;" do?

A: The expression is undefined.

3.3b: Here's a slick expression: "a ^= b ^= a ^= b". It swaps a and b without using a temporary.

A: Not portably; its behavior is undefined.

3.4: Don't precedence and parentheses dictate order of evaluation?

3.3b: Here's a slick expression: "a ^= b ^= a ^= b". It swaps a and b without using a temporary.

A: Not portably; its behavior is undefined.

3.4: Don't precedence and parentheses dictate order of evaluation?

A: Operator precedence and explicit parentheses impose only a partial ordering on the evaluation of an expression, which does not generally include the order of side effects.

3.5: But what about the && and || operators?

A: There is a special exception for those operators: left-to-right evaluation is guaranteed.

3.8: What's a "sequence point"?

A: A point (at the end of a full expression, or at the ||, &&, ?:, or comma operators, or just before a function call) at which all side effects are guaranteed to be complete.

3.9: So given a[i] = i++; we don't know which cell of a[] gets written to, but i does get incremented by one, right?

A: *No*. Once an expression or program becomes undefined, *all* aspects of it become undefined.

3.12: If I'm not using the value of the expression, should I use i++ or ++i to increment a variable?

A: Since the two forms differ only in the value yielded, they are entirely equivalent when only their side effect is needed.

3.14: Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?

A: You must manually cast one of the operands to (long).

3.16: Can I use ?: on the left-hand side of an assignment expression?

A: No.

Section 4. Pointers

4.2: What's wrong with "char *p; *p = malloc(10);"?

A: The pointer you declared is p, not *p.

4.3: Does *p++ increment p, or what it points to?

Source: Contents are provided by Technicalsymposium Google Group Members.
Disclaimer: All the above contents are provided by technicalsymposium.com Google Group members.
Further, this content is not intended to be used for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.

Placement Papers & Answers PDF-Download



Aptitude & Placement Papers & Answers PDF



Technicalsymposium.com-All Study Materials PDF-Free Download







Technicalsymposium.com-Free Live Support-Chat with Our Experts

Official Contact: +91-9245556793 (Whatsapp Message / SMS / Voice Call)


Our Expert team is ready to answer all your questions immediately-Feel free to speak in Tamil/English.

(Example:Events info/Lecture Notes/Off-Campus & All Jobs/Projects & All education information)

Working hrs (IST): (Morning: 10:00AM-3:00 PM) and (Evening:5:00 PM to 10:00 PM)

All Latest Question & Answer Page (FAQ)-Click here