正规365体育投注

Questions tagged [c++]

C++ is a general-purpose programming language. It was originally designed as an extension to C, and has a similar syntax, but is now a completely different language. Use this tag for questions about code (to be) compiled with a C++ compiler. Use a version specific tag for questions related to a specific standard revision [C++11], [C++14], [C++17] or [C++20] etc.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

C++ localtime does not consider day saving time altough the system does

I check the date of system in linux with date command. It gives me correct result: My timezone is UTC+1 and day saving time is applied; in summer or winter, the system gives me my local time correctly....
-1
votes
0answers
10 views

I m getting floating point exception in the below code. I have written the code for the below question. Could you help me identify the error?

I have answerd two questions. Firstly, you have to tell what is the minimum amount of money you have to spend to buy all the N different candies. Secondly, you have to tell what is the maximum amount ...
1
vote
1answer
14 views

C++ std::add_const, why the implement can work for reference?

In cppreference add_const may implement as template< class T> struct add_const { typedef const T type; }; When I try a reference type, like std::add_const<int&>, it is int&. ...
-2
votes
0answers
19 views

How to implement this question to c++ array

i have question and answer here, but how to implement this to c++: Question : intA[10], known &A[0] = H1000. How many &A[7]? Answers : int is 2 bytes Displacement 7-0 = 7 * 2 bytes = 14 ...
3
votes
2answers
37 views

Smart Pointers(shared_ptr)

i try to learn how to use smart pointers. I use for the long time normal pointers and i think i need some upgrade of my skills. I make some research, i understand some aspects of smart pointers, but ...
0
votes
0answers
10 views

VCRUNTIME140_1.dll for distributing your app

I run my app on a just installed windows10 system and it gives me the following error: vcruntime140_1.dll was not found What I need to do is just to put that .dll inside the project folder. But I've ...
0
votes
2answers
28 views

is an array just one variable with many data?

hi i'm confused about arrays. When you declare them is like having 1 variable and many data or many variable and one data type?
0
votes
1answer
8 views

How to create png image from QGraphicsScene in one click on a button

How to create png image from QGraphicsScene in one click on a button , i have a gui and a button named to_png so I want to create a png picture of my QGraphicsScene when I click on this button
1
vote
1answer
15 views

Relative path for __FILE__ and PDB

I want to hide machine specific path part from executable. Is it possible to force relative path for PDB symbols and __FILE__ macro? So that some/all initial parts of path are not put into file? I ...
-1
votes
0answers
21 views

C++ decorator: Access public function of base class from outside

I want to try the use of C++ decorators and I have some questions. Using this example: http://gist.github.com/dlivingstone/3006324#file-decoratormain-cpp #include <string> #include <...
3
votes
1answer
36 views

Why is there no 64-bit API for winsock?

Calls such as send() and sendto() in the Winsock API take a primitive int to dictate the size of their buffer parameters. This obviously places a 32-bit limit on the maximum size buffer that may be ...
-1
votes
0answers
8 views

How to use exiv2 library in c++ program to extract exif data of an image

I have tried using exiv2 in visual studio but got an error that exiv2.dll cannot be found. I am not quite getting how to use exiv2 in linux using g++ and c++11.
0
votes
0answers
24 views

C++ grid class (std::vector of cells) custom resizing function causes segmentation fault

I have a 2D grid class which is made up of cells, I must store the cells in a 1D std::vector (due to specification) that models the 2D grid. I have written a Grid::resize function that resizes the ...
0
votes
0answers
28 views

How do I prime factorize large numbers?

I'm trying to solve Project Euler third question but while my code works perfect with small numbers when i try to use big number it doesnt give me any answer #include<iostream> using std :: ...
1
vote
1answer
25 views

Upcasting std::shared_ptr<Derived> to std::shared_ptr<Base> with templates

I have 4 classes in an inheritance chain: A->B->C, A->B->D, where B is the only class template. I would like to have an std::map that maps between ids and object pointers (C or D), but I'm having ...

15 30 50 per page
1
2 3 4 5
44088