很有挑战性的题目(不断更新)

很有挑战性的题目(不断更新)

1. The second initialization below fails to compile. What can we infer about the definition of vector?

1 vector < int >  v1( 42 );  // ok:42 elements, each 0
2 vector < int >  v2  =   42 // error:what does this error tell us about vector?

2. Given this program:
#include  < iostream >

int  main()
{
    std::cout
<<"Hello, world!\n"<<endl;
    
return 0
}
modify it to produce this output:
Initialize
Hello,world!
Clean up
Do not change main() in any way.

你可能感兴趣的:(很有挑战性的题目(不断更新))