c++ tag

886 questions


1 answers
77 views
0
Can I find out the cache size (in lines) within the C/C++ program?

Please tell me the code to find out the cache size (in line units) in the C/C++ program.My computer uses Linux and I would appreciate it if you could tell me the other platform code.It would be nice i...


1 answers
43 views
0
To capitalize the entire string type string

Is there a way to capitalize the entire string at once?What I found on Google is char type, but I have to write in string type type

2 years ago

1 answers
131 views
0
To quickly raise the result of integer division in C/C++

I know that C/C++ always lowers the result of dividing int.I know that math.h has ceil(), but I want to know how to raise the header right away without including it.My code is inefficient by comparing...

2 years ago

1 answers
51 views
0
c++ constructor questions

#include <iostream>#include <cstring>using namespace std;namespace COMP_POS { enum { CLERK = 1, SENIOR, ASSIST, MANAGER }; void ShowPositionInfo(int pos) { switch (pos) { case CLERK: c...

2 years ago

1 answers
26 views
0
Question about default c grammar string segmentation error.

char* Req_topic[] = {0,}; char Req_topic_SerialNumber[] = {0,}; strcat(Req_topic_SerialNumber , qqq/aaa/bbb/); strcat(Req_topic_SerialNumber, SERIALNUM); strcat(Req_topic_SerialNumber , /cccc); print...

c c++
2 years ago

1 answers
110 views
0
Is there any way to detect int-type overflow in C/C++?

Please let me know if there's any other way I can do itI heard that there is an overflow flag in the hardwareI've never seen it on C/C++. int a, b, c;test=a*b;if (test/b!=a) {} //overflow detection -&...

2 years ago

1 answers
136 views
0
Split with string spaces

In C++, if there's a string with a space, What's the best way to split? Not a quick way, but a good way to look.

2 years ago

1 answers
67 views
0
How do I find items in std::vector?

I want to find out if there's an element in the vectorHow do we figure it out?How can I create item_present in the code below? if ( item_present ) do_this();else do that();

2 years ago

1 answers
89 views
0
Why do you define a constructor with parameters and the default constructor without parameters disappears?

If you create a constructor with parameters in C#, C++, and Java, the default constructor without parameters disappears.Before, I thought it was just like that, but I suddenly became curious about why...


1 answers
26 views
0
I tried to play the C language dice game, but it didn't workPlease give me the part to modify.

List itemGame Rules Roll two 12-sided dice.The player starts with 100 coins in the balance.When the third die enters between the two dice, the coin is earned as much as the bet is made, and the balanc...

c c++
2 years ago
« - 65 - »

© 2024 OneMinuteCode. All rights reserved.