Question du test C++

Quel est le résultat du code suivant ? #include <iostream> #include <string> using namespace std; int main() { int a = 10; int b = 20; int c = a + b; cout << c; return 0; }

Difficile

What is the output of the following code:

int main(int argc, char *argv[])
{
        	
        	try
        	{
     	           	char* ptr;
     	  
     	           	strcpy(ptr, "C++ world");
     	  
     	           	ptr++;
     	  
     	           	std::cout<<ptr<<std::endl;
        	}
        	catch(...)
        	{
  	              	std::cout<<"caught some unhandled exception"<<std::endl;
        	}
        	return 0;
}

Auteur: Abha AgrawaStatut : PubliéeQuestion passée 400 fois
Modifier
0
Évaluations de la communautéPersonne n'a encore évalué cette question, soyez le premier !