c++ tag

886 questions


1 answers
87 views
0
What is object slicing?

I heard it somewhere, but it doesn't come outWhat is object sliding?


1 answers
77 views
0
How do I turn std::map to repeat?

std::map< std::string, std::map<std::string, std::string> >My brother m[name1][value1] = data1;m[name1][value2] = data2;m[name2][value1] = data1;m[name2][value2] = data2;m[name3][value1] =...


2 answers
19 views
0
a program that turns work into a monthly basis

#include <iostream>using namespace std;void mthchange(int day) { int mday = 0, mth = 0; int arr[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30}; while (mday <= day) { mday += arr[mth];...

c++
2 years ago

1 answers
52 views
0
A message appears that there is no default constructor.

Point class, which stores coordinates of points, andRectangle class that inherits Shape.#include <iostream>#include <vector>#include <string>using std::cout;using std::endl;class Poi...

2 years ago

1 answers
118 views
0
How do I lowercase std::string?

How do I lowercase std::string?Is there any other way besides my sauce?This looks so messychar upperToLower(char in){ if(in<='Z' && in>='A') return in-('Z'-'z'); return in;}...std::trans...


2 answers
37 views
0
[Thinking hard] Programming? What is the career path of a programmer?

I learned about C language and C++ in first gradeIn the first semester of the second grade, 'data structure theory' and 'multimedia programming' are two required subjects. I wonder what is the differe...

2 years ago

1 answers
116 views
0
What is the lifetime of the static variable in the c++ function?

As far as I know, the static variable defined in the scope of the function is initialized only once and remains even after the function endsWhat is the exact lifetime?When exactly are the constructors...

2 years ago

1 answers
75 views
0
Why do you have to cover it with a block when you repeat only one line of code?

I'm taking a C++ course and in the textbook,It says so. Other than that, you can understand it for readability or safety reasonsI don't understand to use {} even when writing a line.I think the source...


1 answers
77 views
0
Which is the better way to divide an integer by 2?

Which one is better between the two methods below? Please write down the reason, tooint x = 3;x = x >> 1;x = x / 2;

2 years ago

1 answers
139 views
0
Why is this code divided into several alphabetic ranges?

When I wrote in C, I only checked the value between 'A' and 'Z' when I checked the capital letters. inline int is_upper_alpha(char chValue){ return ((chValue >= 'A') && (chValue <= 'Z'))...

2 years ago
« - 70 - »

© 2024 OneMinuteCode. All rights reserved.