Questions tagged as 'c++'

1
answer

How do I declare a library within a class in C ++?

I need to use variables of type string , the problem is that I can not include libraries within my classes in Code :: Blocks, is there anyway to include the string / string.h library in my C ++ class ? The code for my clas...
asked by 23.08.2016 / 21:06
1
answer

What happens on these lines in C ++?

This is an encoder reading routine which detects which direction of rotation of the encoder. References are the left and right pins appreciated as MSB and LSB bits. The code works perfectly, but I do not understand what exactly happens in the ex...
asked by 17.05.2016 / 20:50
1
answer

Repainting screen every few minutes without crashing - C ++

I have the following situation: I have to repaint the screen every few minutes so that objects on the screen get stuck on account, but this has to happen in a way that the program will not crash. I have tried to make a Thread and call the...
asked by 08.06.2014 / 21:28
2
answers

Question about logical operators

I wanted to know the resolution of the following question:    In a pen, there are several ducks and rabbits. Write a program that asks the user for total heads and total feet and determine how many ducks and how many rabbits are found in the...
asked by 17.05.2015 / 06:06
1
answer

Play Sound (WINDOWS)

How do I play sound in a program developed in the C / C ++ language? Environment (WINDOWS)     
asked by 13.05.2015 / 19:19
1
answer

Parameters of the scanf function

While studying the scanf function with a little more depth, I had a question about the arguments I put before% when reading a string, that is scanf("argumentos...%s",minhastring) , in the following codes I add a space and the ' J 'b...
asked by 27.06.2016 / 03:15
1
answer

Is it possible to "simulate" C ++ Templates in C?

Taking a data structure of type stack with array for example : typedef struct stack_s { int top; int item[STACK_MAX_SIZE]; } stack_t; Doubt appears when for some reason I want to use a stack with a data type other than int...
asked by 15.10.2016 / 18:04
2
answers

What is the difference between initializing a constructor or doing assignment inside the constructor?

What's the difference between the two examples below? Should I also assign the value inside the constructor in this class even though I have initialized? Example 1: class sof{ int teste; public: sof(int t) : teste(t){} ); Examp...
asked by 02.12.2016 / 02:39
1
answer

How to make an HTTP GET request for a web service with Arduino

With a request via GET for a web service with Arduino , using the following URL and passing a parameter
asked by 01.12.2015 / 13:29
1
answer

doubt about displaying values and desfilerar in the Thread Queued?

How to display the correct values in the queue because it displays from the last to the first. #include <iostream> #include <cstdlib> using namespace std; struct Item { int dado; Item *prox; }; struct Fila { Item *hea...
asked by 21.11.2015 / 16:00