Questions tagged as 'c++'

1
answer

You are executing the commands directly without typing the other notes

You are not typing the rest, just typing the first one is already going to the last one. #include <iostream> #include<stdio.h> int main(void) { int n1,n2,pim,rn1,rn2,rpim,rfinal; rn1=n1*4; rn2=n2*4; rpim=pim*2;...
asked by 20.11.2018 / 01:57
1
answer

Problem with Running Watershed Distance Transform in OpenCV 4.0.0

I'm working on an object detection project. I use OpenCV 4.0.0 and codeblocks 16.01 on Ubuntu 18.04.1. I'm testing the watershed distance transform technique using the code in this tutorial: link I just modified the path to my test image...
asked by 26.11.2018 / 04:27
2
answers

Compile error in C ++ when accessing structure in function

I am creating a code that stores the information of 3 people within a struct , but I am having a compile error when I save the age option in struct . The error is this: /home/arthur/Área de Trabalho/pj/pj.cpp: In function ‘void cadast...
asked by 02.11.2018 / 15:52
1
answer

Initialize members of a structure, accessed via pointer, in the constructor of a C ++ class

Imagine the DateTime class as follows: datetime.hpp: #ifndef DATETIME_HPP #define DATETIME_HPP #include <ctime> class DateTime { public: DateTime(); DateTime(int, int, int, int, int); private:...
asked by 27.09.2018 / 16:57
1
answer

Could not find -lGL

I'm running the default CodeBlocks for OpenGL on Ubuntu: /* * GLUT Shapes Demo * * Written by Nigel Stewart November 2003 * * This program is test harness for the sphere, cone * and torus shapes in GLUT. * * Spinning wireframe and smoo...
asked by 24.09.2018 / 13:31
1
answer

My struct type is not recognized within my class

People, I'm doing the implementation of a stack with pointers in C ++ and I have the following code for now: template <class T> struct Node { T item; Node *prox; }; class Pilha { private: int tamanho; Node *topo;...
asked by 24.09.2018 / 01:39
1
answer

How to fix the error: "declaration of template parameter 'T' shadows template parameter" in C ++?

I'm trying to make a graphics program, but I'm having a problem ... My code is the one: main.cpp: #include "point_2d.h" #include <iostream> int main() { cge::point_2d p(5, 5); p.x = 6; std::cout << p.x << " "...
asked by 11.10.2018 / 14:16
1
answer

Problems wprintf with long int c ++

Hello, I'm having trouble trying to print "big" integers in c ++. To be more specific using visual studio 2017 int main() { _setmode(_fileno(stdout), _O_U16TEXT); long rr = 6448915477954560; wprintf(L"%ld\n", rr); } Problem:...
asked by 21.09.2018 / 17:07
1
answer

How to test the runtime of a code in Visual Studio 2017?

I'm trying to test the runtime of a code, however I'm always getting incorrect values, the first test will always be the one that has the worst time. And most of the time the second test is always 0. #include <iostream> #include <math...
asked by 06.08.2018 / 20:01
1
answer

Using threads in classes

Hello, I have a problem with using threads. Since I use mingw to compile my projects, and this header is not implemented, I use this header to compile my projects. However, I'm having some difficulties regarding the use of thread...
asked by 13.07.2018 / 11:52