Questions tagged as 'c++'

2
answers

How to limit decimals?

I have a question, can you limit the number of decimal places in C ++? float x = 2.958; Instead of rounding up or down using floorf , roundf , can you just pick up the two numbers after the comma? That would look more or less...
asked by 26.10.2015 / 12:27
1
answer

How to put variables within vectors?

How do I create variables within a vector? Something like: int arr[] = {int x=1, int y = 2};     
asked by 17.12.2014 / 23:13
4
answers

When to implement functions in the header?

I often split the program into small modules, each with its own header and implementation. In general, the level of abstraction used allows the implementation to be completely changed without breaking the rest of the module-dependent code. In...
asked by 30.01.2014 / 16:58
1
answer

Why is there no "logical XOR" in C ++?

I was thinking and this question came to me: "Logical XOR" ! For example: true false = true true true = false false true = true false false = false     
asked by 10.08.2018 / 03:40
2
answers

What is the C / C ++ volatile operator?

I've seen some code in C / C ++ statements like this: volatile int i = 0; I would like to know what the volatile operator is and in what cases I should use it.     
asked by 22.03.2014 / 15:16
3
answers

Does anyone know how to enter names in alphabetical order in a c ++ vector?

I made this code but it does not work right, it inserts alphabetically in reverse. void inserirNomeNaLista(vector<string> &lista) { vector<string>::iterator itr; string nome; cout << "Digite o nome para ser in...
asked by 22.02.2014 / 05:24
1
answer

How to pass an array as an argument of a function per copy?

As an array is used as a pointer in many situations . A parameter that expects an array is actually a pointer, so what it copies is the memory address and not the array data, p> But what if I want to get the data right? I know the size...
asked by 27.01.2017 / 13:00
1
answer

What is a linker for?

Some languages use a linker or Wikitravel as it is also called. What is its function and relationship to the compiler? Why do some languages do not have a linker ?     
asked by 21.03.2017 / 16:01
1
answer

Why performing offloading to the GPU is a good idea?

I'm following a few forums on the internet and I realize that recently there has been a lot of talk about doing offloading tasks for the GPU. Mozilla has implemented a new engine for your browser called Servo . In his heart he makes...
asked by 23.02.2017 / 20:57
1
answer

Is there any project organization standard for C ++?

In Java and ActionScript3.0 we use namespaces based on the directory path, I see a lot of use of namespace , but are not based on the path of the "location" class in the folder. I searched a lot if there was any kind of organizat...
asked by 20.11.2016 / 01:26