All Questions

1
answer

Why can I access a structure other than the pointer?

When I declare a pointer to struct I can access members without putting the address of a struct , why is it possible? For example: struct exemplo{ int a ; }; int main() { struct exemplo *p; p->a = 10 ; }    ...
asked on 22.12.2015 / 22:24
1
answer

Vector manipulation in C ++

Is there any problem if I go through a vector by taking its size with vector.size () and then make a for on the vector? I'm asking this question because almost every time I see vectors manipulation, an iterator is used to traver...
asked on 06.02.2016 / 04:39
1
answer

Python Combat Game

I'm a beginner in programming and I'm trying to make a simple little game to apply my knowledge about conditionals, repetition and the Random module, but I'm having some semantic problems. My goal is to attack the monster with a random number...
asked on 08.02.2018 / 19:10
2
answers

Change boolean column to integer

I'm using a database that has a field called: status: boolean , however I want to store the values of the Radio Button (0,1,2) so I need to change to integer . I'vetried:ALTERTABLEOSALTERCOLUMNSTATUSTYPEBOOLEANUSING(trim(STATUS):...
asked on 24.10.2017 / 17:46
1
answer

What is a database procedure?

At times I have been following questions that involve the term procedure in database, then doubts: What is procedure ? Where to use it, what is it for? If possible use examples clear the mind of the layman (mine).     
asked on 29.09.2017 / 02:02
1
answer

Is it worth using binary operators to gain performance?

I have the following situations: if (1 & 1){} and if (1 == 1){} According to what I've learned, working with bitwise operators causes a much better performance in the program, so I've had some doubts: Is performance in the f...
asked on 03.01.2018 / 22:04
1
answer

Smart Pointers

I was studying smart pointers and based on this blog: link #include <iostream> template <class T> class SmartPointer { T *ptr; public: SmartPointer(T *p):ptr(p) {} ~SmartPointer() {delete ptr;}...
asked on 03.12.2017 / 10:44
2
answers

What is Retrofit?

I'm using the retrofit in an application to consume a Java Web Service and I'm in doubt:    Is Retrofit a library or an API?     
asked on 06.12.2017 / 00:25
1
answer

What happens if a binary search does not find the element?

What happens if a binary search does not find the element? Does it enter loop ? What is the best way to end execution?     
asked on 23.11.2017 / 02:52
2
answers

How to create a non-repeating sequential number per user

Work on a bill invoice project, in this project there is the Emissor entity. My database Sql-Server may have multiple emitters. Each issuer can issue its invoices. Each invoice must have a unique, sequential number. This seque...
asked on 14.03.2018 / 19:16