what is the diffrence between ++x , x++ pleaaaaase ???
Answer Posted / dallasnorth40
++ before the variable increments the variable before the
value is taken/used.
++ after the variable takes/uses the value, then increments.
Given:
int x = 5;
int y = 0;
y = x++;
This will leave y = 5 and x = 6.
y = ++x;
This will leave y = 6 and x = 6.
| Is This Answer Correct ? | 27 Yes | 3 No |
Post New Answer View All Answers
Code for Easily Using Hash Table?
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
Code for Two Classes for Doing Gzip in Memory?
1+1/2!+1/3!+...+1/n!
what mean void creat_object?in public class in this code class A{ public: int x; A(){ cout << endl<< "Constructor A";} ~A(){ cout << endl<< "Destructor A, x is\t"<< x;} }; void create_object(); void main() { A a; a.x=10; { A c; c.x=20; } create_object(); } void create_object() { A b; b.x=30; }
how to write a program that opens a file and display in reverse order?
write a program using virtual function to find the transposing of a square matrix?
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
How to Split Strings with Regex in Managed C++ Applications?