Questions tagged as 'c++'

1
answer

C ++ smart pointers and functions

I'm reading an article in msdn about smart pointers. In the article there is this example: class LargeObject { public: void DoSomething(){} }; void ProcessLargeObject(const LargeObject& lo){} void SmartPointerDemo() { // Creat...
asked by 21.03.2016 / 19:01
2
answers

how to use a switch inside a switch?

In case, I can not choose the menu option to select difficulty, am I doing the correct way the switch inside a switch? #include <stdio.h> #include <stdlib.h> #define TENTF 5 #define TENTD 3 int main() { char opcao; int n...
asked by 22.04.2016 / 21:53
1
answer

Debug c ++ in Visual Studio

I installed Visual Studio C ++ 2010 Express. I created a project using Win32 Console Application, I added a New Iten C ++ File (.cpp) to this project, but at the time of running the error appears: 1>LINK : fatal error LNK1123: failure durin...
asked by 04.03.2016 / 18:36
1
answer

Function Parameters CvRTrees :: train () - OpenCV / C ++

Hello I need to use the CvRTrees::train() function of OpenCV, but I do not quite understand the parameters used. To help, the site has no documentation on the parameters of this function. The function specification is: bool CvDTre...
asked by 05.01.2016 / 18:15
1
answer

C ++ problems with overloading operator + (undefined reference to 'operator + (...)

I'm having trouble overloading the + operator in C ++. Anyone have any idea what's wrong? To perform the unit tests I'm using googletest in Ubuntu. (I wanted to do this to make the code cleaner) Code: ---- vector.cpp ----- vector<d...
asked by 22.02.2016 / 15:20
1
answer

Error writing binary file using fwrite

Why this code snippet DataRootDir data = rootdir[i]; fwrite (data, sizeof(DataRootDir), 1, arq); always returns error error: cannot convert 'DataRootDir' to 'const void*' for argument '1' to 'size_t fwrite(const void*, size_t, size_t, FIL...
asked by 19.02.2016 / 19:53
2
answers

Doubts c ++ classes [closed]

Good morning guys! I'm seeing classes and I've seen this syntax in one of the examples: vector<line *>line_table; vector<line *>::iterator iterator; line parser * basic_parser; long current_line; What does this template mean w...
asked by 04.10.2015 / 19:58
1
answer

Targeting failure

I created a class to display a string on the terminal, but in addition to displaying the string , also displays the following message: "segmentation failure". I debugged with GDB, but I could not resolve the error. Here is the code below: #...
asked by 03.11.2015 / 20:59
1
answer

Is it possible to pass string from the string class as a pointer to function?

Is it possible to pass string from string class as pointer to function? example: void separaStr(string *modulo, satring *nmodulo, *digito){}     
asked by 25.09.2015 / 21:06
1
answer

String usage gives error

At the beginning of the code I declare the variable nome as char and when I try to get the nome variable down there in the code it gives error, I already tried in several ways and that way down there until it works, but some...
asked by 18.09.2015 / 21:00