Posts by Gui Reis • 137 points
14 posts
-
1
votes1
answer45
viewsQ: Print with variable or by direct account?
Are these two methods the same in terms of performance? Is one better than the other or is it better in terms of code organization? Method 01: direct printf("%.4lf\n", sqrt( pow(x2-x1, 2) +…
-
0
votes1
answer66
viewsA: Fix infinite loop
Its function is in the infinite loop pq there is no change in its Loop condition, so it always stays the same. In case the error is in range of your for. The function range takes the range of…
-
0
votes5
answers412
viewsA: Save or not the commands used in Mysql
Right now I’m doing a simple CRUD (Create, Read, Update and Delete) project that uses Python and SQL. I saved the script made for the creation of the Database and still commented each line. The…
-
0
votes1
answer1936
viewsA: Powershell and VS Code does not recognize "Set-Location"
Good. I managed to solve. Really if you add before any command (native to Powersheel) the line Import-Module -Name Microsoft.PowerShell.Management and then the Powershell command itself (which is…
-
0
votes1
answer1936
viewsQ: Powershell and VS Code does not recognize "Set-Location"
Man PowerShell does not recognize the Set-Location, this has been happening for a while now every time I run a code in VS Code because my work and projects are in the cloud and on another HD but I…
-
0
votes3
answers174
viewsA: Deactivate Pycharm autocomplete
I also disagree about this. The more practical and facilitated for you is better. There are things that IDLE itself not only reminds you of, but also shows you other possibilities that you haven’t…
-
5
votes2
answers197
viewsQ: "List Comprehensions" is it worth it?
Is the use of List "Comprehensions" in Python a good use? Affects program performance (runtime, etc..)? Some examples: # Lista com números pares de 0 a 10: par = [x for x in range(11) if x % 2 == 0]…
-
0
votes2
answers179
viewsQ: Is there realloc() in C++?
The realloc() is unique to C? Would it have any function that would be equal in C++?
-
-1
votes1
answer1327
viewsQ: How to convert String to Int in C++
I’m not able to convert this simple program. how do you convert? #include <string.h> #include <stdlib.h> using namespace std; int main () { int i; string a; i = atol (a); } . Error…
-
2
votes1
answer73
viewsQ: How to call the constructor within a method
I have a simple college exercise to mess with the vector. Basically these are the actions that we should do: cout << "\tMexendo com Vetor\n"; cout << "\n\nEscolha uma das opcoes para…
-
3
votes1
answer198
viewsQ: How to create multi-line strings in C++
Have some way to print output, for example a text, without having to print line by line? For example, in Python: print(""" Meu nome eh Guilherme, tenho 19 anos, faço aniversário em Nov. Estudo o…
-
0
votes1
answer448
viewsA: Object oriented: "Undefined Reference to" in main.cpp
Good.. I managed to solve in two methods: - Primeiro (errado): Just take the #include "Carro.h" of the file . cpp and put at the end of the file . h #include "Carro.cpp" But this is not recommended.…
-
0
votes1
answer448
viewsQ: Object oriented: "Undefined Reference to" in main.cpp
I’m starting POO (Object Oriented Programming) and am separating my attributes and methods from the class into different files. They are reading each but in main.cpp is giving the error "Undefined…
-
0
votes5
answers821
viewsA: Avoid blank input data
If you want to restrict a particular entry you need to create a condition. One way to solve this problem is by using try and except. The idea would be: the program will try to do an action and if it…