Questions tagged as 'c++'

1
answer

What is raw () in ncurses.h?

Recently I'm trying to learn more about the ncurses library and I came across some codes that use raw(); When I took it to test what happened, it did not change anything, the code compiled and worked perfectly. So why does raw () exist? Wha...
asked by 10.05.2018 / 23:19
1
answer

Help with signal and slots (connect in slot of another file)

Good morning dear, I created a Qt Widget Application with Qt Creator (Qt 5.6.1). The project has the following structure: myproject.pro Headers dialogform.h mainwindow.h Sources dialogform.cpp main.cpp...
asked by 24.01.2017 / 13:18
1
answer

Pointer to function in a C ++ class

I'm having trouble putting a pointer to a function in a class: int Menu::validaescolha(){ cout << 1232; return 1; } int Menu::inicial(){ int (Menu::*funcs)() = &Menu::validaescolha; funcs(); return 0; } Return...
asked by 26.02.2017 / 00:04
1
answer

How does it work to use a vector of type struct? (C ++)

I would like help with understanding how to declare a vector of type struct. In the example of the code below I create the struct configcarros and would like to create a vector of the type of this structure and later access num_car and tempodevo...
asked by 28.10.2017 / 03:06
1
answer

What is and what is the structure sockaddr_in?

Lately I've been wanting to program a network sockets in C ++, but since the materials on the internet are a bit limited, I only show how to program the sockets without explaining in more detail the use of each function. I ended up getting lost...
asked by 26.09.2017 / 23:51
2
answers

Is it possible for an attribute of a class to be the class itself?

I'm starting to learn% object-oriented%, and I have to do an algorithm using threaded lists. In C++ , I used a structure that had as one of the attributes a pointer to the structure itself. I would like to know if it is possible to do some...
asked by 23.09.2016 / 16:17
1
answer

Why is it possible to store a string in a char pointer?

Why does char store a single character and the pointer points to its value in memory, so should it not have only one character? Example: char *str = "Ola"; Why str does not store just one character?     
asked by 17.11.2018 / 17:55
1
answer

Performance difference between static and shared library

Which is the best in performance? Compile the program using libraries such as MySQL Connector and SQLite as static (getting inside the compiled binary) or as shared getting separated from the binary. In addition, can you use a shared libra...
asked by 13.04.2016 / 03:42
1
answer

C ++ exponentiation operator

About a question recently posted and answered Is there any reason - historical or not - for C ++ (as well as many other programming languages) not to include an operator for exponentiation? For example, when I want to calculate 5 to 7.2 I ha...
asked by 11.12.2015 / 23:06
1
answer

Problem in coding Strings Qt

I'm having a problem encoding strings in Qt . When I show something in a QMessageBox or give drawText to paintEvent , my strings are badly formatted, as if they were not in the correct encoding. Here's how it appears...
asked by 15.06.2014 / 04:17