what is the difference between int &r and int& r
Answers were Sorted based on User's Feedback
Answer / nakubu
There is no difference; C++ is pretty much whitespace
agnostic. What depends is its use:
int function(int &r)
{
...
}
is a function declaration that accepts an integer pointer as
a parameter, and:
int a = 7;
int &r = a;
will make a reference to an integer.
The spacing around the & makes no difference.
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / kumar sourav
according 2 me int &r is a declaration in which address of
r is of integer datatype whereas int& r is an alias or we
can say it a reference i.e we can put any other variable
instead of r.
| Is This Answer Correct ? | 6 Yes | 6 No |
Answer / shiv
according to me int &r is declaration , and int& r is
reference .
| Is This Answer Correct ? | 2 Yes | 6 No |
what is the difference between int &r and int& r
write a program to perform generic sort in arrays?
Min-Max Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and calculate its complexity T(n).
1 Answers Infosys, Qatar University,
Given 1 to n distinct random number of which n+1th element was duplicated. How do find the duplicate element and explain the time complexity of the algorithm.
Code for Easily Using Hash Table?
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
how to write a program that opens a file and display in reverse order?
Write a program to enter 10 number of integer entries into an array n and then odds up all the odd entries. the program then displays the result. plssss answer assss fast asss u can...
PROBLEM #8 The cashier at the counter of a Super Store, Mr. Khazaanchi has the following bundles of rupee cash notes with him: Rs. 1, 2, 5, 10, 50, 100, 500, 1000 A customer comes at his counter with various items that he has shopped. Mr. Khazaanchi totals the item prices and tells the customer his total amount payable. The customer gives Mr. Khazanchi some amount of cash. Find the total number of rupee notes of each denomination (i.e. 1, 2, 5, 10, 50, 100, 500, 1000) Mr. Khazaanchi will have to give to the withdrawer ensuring that the total number of rupee notes are minimum.
Code for Two Classes for Doing Gzip in Memory?
write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000
What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }