c++ tag

886 questions


1 answers
29 views
0
C++ I'd like to ask you a question

#include <iostream>#include <string.h>using namespace std;class String {private: char* strData; int len; public: String() : strData(NULL), len(0) {} String(const char* str) { len = strn...

c++
2 years ago

1 answers
23 views
0
Initialize and initialize while creating class objects

#include <iostream>using namespace std;class CTest{public: CTest() { m_Value = 0; } CTest(const CTest& obj) { m_Value = 2; } int m_Value;};void main(){ CTest t; t.m_Value = 1; CTest t1(t);...

c++
2 years ago

1 answers
23 views
0
It's a generator and an extinction exercise. I'm asking you a question because I'm curious about other ways

#include <iostream>#include <string>using namespace std;class CPerson{public: CPerson(string _name, int _id) { m_Name = _name; m_ID = _id; } CPerson(const CPerson& _person) { m_Name...

c++
2 years ago

1 answers
24 views
0
c++ pointer swap problem

It's a basic question I created a function that swaps pointer addresses with each other, but when I print it out, it becomes the original value.Debugging doesn't solve the question! #include <iostr...

c++
2 years ago

1 answers
93 views
0
C++ variable initialization, substitution

#include<iostream>using namespace std;int main(){ int i = 10, j = 0,k=0; for (i; i < 31; i++) { for (j; j < 6; j++) k = (i * j) + k; } cout << k << endl;}If you output the v...

2 years ago

1 answers
130 views
0
Function pointer question.

I understand that typeef or using can be used to simplify the use of function pointers.typedef void func1(int, int);typedef void (&func2)(int, int);typedef void (*func3)(int, int);By the way, I wa...


1 answers
60 views
0
Cannot convert argument 1 from 'float' to 'float[]'

#include <iostream>using namespace std;float func(float a[]);int main(){ float x[3] = { 1.5, 2.5, 3.5 }; *cout << func(x) << endl;*}float func(float a[]){ float sum = 0; for (int i =...

2 years ago

2 answers
17 views
0
I have a question for c++ novice const. "T"

// Node structuretemplate <typename T>struct Node { T idata; Node<T>* ptr_next; Node<T>* ptr_prev; // Initialization when no value is entered, Node() : idata(0), ptr_next(nullptr),...

c++
2 years ago

1 answers
102 views
0
Question for reference: Why do I get a compilation error if I don't use the factor as a reference form in the copy generator part?

class account{private: int accid; int balance; char *name;public: account(int id, int money, const char* a) :accid(id), balance(money) { name = new char[strlen(a) + 1]; strcpy(name, a); } account(c...

2 years ago

1 answers
95 views
0
I want to get the results of the console window into the dialog.

I want to configure the screen that appears when I press the Windows Driver Properties window using MFC.Somehow I succeeded in getting information about the type and capacity of the driverI'm at a los...

« - 86 - »

© 2024 OneMinuteCode. All rights reserved.