What will be the output of the following C++ code?
Which of the following keywords is used to deallocate memory?
#include
#include<iostream>
int main()
{
int numbers[4] = {10};
std::cout<<numbers[2];
return 0;
}
What is the correct syntax for declaring a virtual function?
What is the output of the following code?
int i = 10;
int fun(int i) { return (++i * i); }
int main()
{
extern int i;
printf("%d", fun(i));
}
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str("Steve jobs");
cout << str.length();
return 0;
}
How do lists differ from vectors?
# include <stdio.h>
void print(int arr[])
{
int n = sizeof(arr)/sizeof(arr[0]);
int i;
for (i = 0; i < n; i++)
printf("%d ", arr[i]);
}
int main()
{
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8};
print(arr);
return 0;
}
#include "stdio.h"
int main()
{
void *pVoid;
pVoid = (void*)0;
printf("%lu",sizeof(pVoid));
return 0;
}
What is the output of the above C program snippet?