c++ tag

886 questions


1 answers
74 views
0
The difference between the typename keyword and the class keyword in the template

I've seen both of them a lot when defining templates, what's the difference between these two?And the other question is, I saw a template like this on WikipediaWhat does each keyword mean here?templat...

2 years ago

1 answers
87 views
0
Why do we use colons (:) in constructors?

I saw a code like this#include <iostream>class Foo {public: int bar; Foo(int num): bar(num) {};};int main(void) { std::cout << Foo(42).bar << std::endl; return 0;}What is written her...


1 answers
96 views
0
Difference between Reference and Pointer and a pointer

I know that using references makes it easier to read and write code,What exactly is the difference between the two?

2 years ago

1 answers
77 views
0
Is it "long long int" = "long int long" = "int long"?

Both can be compiled. Can I change the order like int long , long int, and long int?If the top two are the same, is the pointer type the same?

2 years ago

1 answers
148 views
0
Why don't you return the reference?

Why can't I return the reference?Personally, I saw a lot of codes that return references, so are all the codes wrong?

2 years ago

1 answers
33 views
0
When do you write "->", "." and "::" respectively?

C++ is related to the class We can use it together.In what circumstances are those three used?

c++
2 years ago

1 answers
140 views
0
To convert a vector to an array?

vector that stores doubleI want to convert double to an array that stores it.What function should I use?

2 years ago

1 answers
105 views
0
What is the fastest way to find out the existence of a file in C/C++11/C?

Is there a standard for C++11/C++/C to find out if a file exists or not?I want to check if the file exists before I open it.What should I do to make an annotation part from the code below?inline bool ...

2 years ago

1 answers
111 views
0
Why does "No newline at end of file" appear?

The C++ compiler keeps saying No newline at end of file and raising the warning.Why should I enter at the end of the source/header file?It's not even an error. It's annoying and I don't feel like it. ...


1 answers
157 views
0
Why should global variables be written to a minimum?

The professor told me to use the discharge variable only when it's really inevitableWhy is that?If there are more functions, it's hard to transfer factorsThis is too much trouble

2 years ago
« - 38 - »

© 2024 OneMinuteCode. All rights reserved.