Why doesn't the code "a[i] = i++;" work?
Answers were Sorted based on User's Feedback
Answer / guest
The variable i is both referenced and modified in the same
expression.
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / abdur rab
The answer from wikipedia
Sequence point comes into play when the same variable is
modified more than once. An often-cited example is the
expression i=i++, which both assigns i to itself and
increments i; what is the final value of i? Language
definitions might specify one of the possible behaviors or
simply say the behavior is undefined. In C and C++,
evaluating such an expression yields undefined behavior.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / vignesh1988i
this line will work.... first the value of i will be in the array and then i will get incremented
| Is This Answer Correct ? | 11 Yes | 18 No |
Not all reserved words are written in lowercase. TRUE or FALSE?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
Can a program have multiple main() functions?
Explain the difference between malloc() and calloc() function?
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
wat is output of the following int main() { const int j=2; int i; switch(i) { case 1:break; case j:break; default:break; } }
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
When should you not use a type cast?
main() { clrscr(); } clrscr();
Tell us bitwise shift operators?
What is the difference between the = symbol and == symbol?
to get a line of text and count the number of vowels in it