c++ tag

886 questions


1 answers
27 views
0
In c++, you get an error writing and building along with the example 'Normal Person Class with Deep Copy Producers' ;;

#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 ...

2 years ago

1 answers
41 views
0
c++ generation of random numbers without duplication

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...

c++
2 years ago

1 answers
72 views
0
To create a constructor for a C++ structure?

How do I create a construct in C++ structure?I want to define the constructor, but I don't know the grammar

2 years ago

1 answers
140 views
0
Initialize static const string in class

Isn't it okay to initialize the static const member variable within the class?The error message says to initialize out of line.I don't want to use #define but what should I do Static data member of ty...

2 years ago

1 answers
23 views
0
What are the advantages of the inline function?

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,...

2 years ago

1 answers
23 views
0
Questions about Arrays and Pointers

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 ...

c++
2 years ago

1 answers
23 views
0
It's a simple question.crying

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...

c++
2 years ago

1 answers
25 views
0
Do you use NULL or 0 for the pointer?

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...

c++
2 years ago

1 answers
44 views
0
What is the difference between #include and #include "filename"?

The method of including C/C++ is to use <> and There are two. What's the difference between the two?

2 years ago

1 answers
115 views
0
Is the bowl type false < true always true?

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.