a) methods in c++ b) class member in c++ c) methods & class member in c++ d) none of the ...
View QuestionThe pointer can point to any variable that is not declared with which of these?
a) const b) volatile c) both const & volatile d) static Answer: c Explanation: Pointer can point ...
View QuestionWhen does the void pointer can be dereferenced?
a) when it doesn’t point to any value b) when it cast to another type of object c) ...
View QuestionThe void pointer can point to which type of objects?
a) int b) float c) double d) all of the mentioned Answer: d Explanation: Because it doesn’t ...
View Question
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void func(const int &a)
{
int temp = 10;
a = temp;
cout<< a;
}
int main(int argc, char const *argv[])
{
int a = 5;
func(a);
return 0;
}
What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using ...
View QuestionWhich of the following operator is used while declaring references?
a) * b) & c) ^ d) -> Answer: b Explanation: & operator is used for assigning references.
View QuestionPick the correct statement about references.
a) References can be assigned value NULL b) References once assigned cannot be changed to refer another variable
View Question
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int &q = NULL;
cout<< q;
return 0;
}
What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using ...
View Question
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int a = 5;
int &q = a;
cout<<&a << endl;
cout<<&q << endl;
return 0;
}
What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using ...
View Question
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int a = 5;
int *p = &a;
int &q = a;
cout<<*p << endl;
cout<<*q << endl;
return 0;
}
What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using ...
View Question