886 questions
#include <iostream>#include <cstring>using namespace std;class Person { char* name; int id;public: Person(int id, char* name); Person(Person& person); ~Person(); void changeName(const ...
srand((unsigned)time(NULL); // Generate a different random number each time you run a programint found1, found2;string fruit_1[8], fruit_2[8];string fruit[8] = { Apple, Apple, Grape, Grape, Melon, Tan...
How do I create a construct in C++ structure?I want to define the constructor, but I don't know the grammar
What are the advantages/disadvantages of the inline function in C++?I heard it's a little faster. It might be faster on an old computer, These days, the compiler optimizes everything, the CPU is fast,...
class Simple {private: int arr[len];};If such a class has an array as a member variable,Will the objects in this class have an array within the object?Or is it in the form of arr pointing to an array ...
I can't upload the picture.using namespace std;int cmxObjCnt=0;class SoComplex {public: SoComplex() { cmxObjCnt++; cout<<cmxObjCnt<<Third Object<<endl; } SoComplex(SoComplex &c...
In the beginning, NULL cannot be used for C++, and only void* type can be assigned, so I wrote (void*)0 together, but these days, it is possible to assign NULL to the pointer.I usually use (void*)0 an...
The method of including C/C++ is to use <> and There are two. What's the difference between the two?
It comes out like this on my computer (Centos 7, gcc 4.8.2), but I wonder if other computers get the same results unconditionally.
« | - 55 - | » |
© 2024 OneMinuteCode. All rights reserved.