c++ tag

886 questions


1 answers
79 views
0
How do I reverse a C/C++ string using only one buffer?

I know how to use two buffersHow do I reverse a C/C++ string using only one buffer?for(int i=0; i<strlen(s1); i++) s2[strlen(s1)-i-1] = s1[i];

2 years ago

2 answers
26 views
0
C++ enum problem in use

#include <iostream>struct Tag{ enum class A { testA }; enum class B { testB };};class Test { Tag m_Tag; Test(Tag tag) : m_Tag(tag) {}};int main(){ Test* test = new Test(Tag::A::testA);}It's a...

c++
2 years ago

1 answers
42 views
0
(Visual Studio) Appears only on my computer while using Visual Studio.

char *a[] = { Hong Gil-dong, Kim Gil-dong, Lee Gil-dong, Park Gil-dong, Choi Gil-dong};All the other computers up there are working fine, but strangely, I...Hong Gil-dong, Kim Gil-dong, Lee Gil-dong, ...

2 years ago

1 answers
96 views
0
While practicing classes in winapi, how do I export to the getter setter or change the value of the imported variable?

// Declare score variables in the Player classm_nScore;Player::Init(){ m_nScore = 0;}// Getter int GetPlayerScore() { return m_nScore; }// Dynamic Assignmentm_pObjects = new Objects;m_pObjects->Set...

2 years ago

1 answers
20 views
0
C++ Inheritance Question. Why are Operators and constructors not inherited but included in child classes?

While studying, in the lecture notesOverloaded assignment operator not inherited – But can be invoked from derived classConstructors are not inherited– Are invoked from derived class’s constructor Tha...

c++
2 years ago

1 answers
89 views
0
Replacing a specific word in a string

string msg1 = hello, hello, kk, kkkk, rrrr;I want to change hello to bye when I'm withstring.replace() is not the function I want

2 years ago

1 answers
96 views
0
Undefined reference in static class member

Why do I get a compilation error in my code?And why does it work well if you convert MEMBER to int without code 1?(compiled in g++ 4.2.4)#include <vector>class Foo { public: static const int ME...

2 years ago

1 answers
101 views
0
class member variable pointer? When do you use it?

class Car{ public: int speed;};int main(){ int Car::*pSpeed = &Car::speed; return 0;}I saw this code, and I wonder when int Car::*pSpeed=&Car::speed; is used in main.

2 years ago

1 answers
79 views
0
Output Questions

#include <stdio.h>class myclass {public: myclass() { printf(a); } myclass(myclass& r) { printf(b); } void operator = (myclass& r){ printf(c); } };int main(){ myclass a; myclass b(a); myc...

2 years ago

1 answers
69 views
0
What if I don't know the length of the string to be entered in c/c++?

When you say that an input is always entered as a stringI don't know the length of the string to be enteredI need to determine the size of the char array, what should I do?If the size is input first, ...

2 years ago
« - 61 - »

© 2024 OneMinuteCode. All rights reserved.