Posts by Lucas Henrique • 229 points
5 posts
-
1
votes3
answers2490
viewsA: What are the differences between pointer and reference in c++?
References play a role similar to a pointer, but the address to which it refers is immutable. When you touch a reference, you’re not doing anything but tinkering with the variable it refers to, it…
-
1
votes1
answer571
viewsA: Put and take whole file?
The practical solution You should know a little bit about file manipulation and IO, and their syntax in C. To read, you should just check where appear the ';', and at these intervals use fscanf with…
-
1
votes1
answer542
viewsA: Given a list of words, return the size of each descending anagram group
As I remember very little of C, I will leave the code in C++ for now and I update :P Wow, that’s a lot! You know what anagrams have in common? They have the exact same letters. So how can we get…
-
3
votes1
answer152
viewsA: Using Unicode in a variable char
wchar_t seu_caractere = L'\u1234' There are other types of data for custom characters, such as char32_t. But in your case, it’s easy to deal with the problem using the wide char.…
-
6
votes1
answer1148
viewsA: How to select positions of the matrix/ random draw?
This is simple. I can give you the code chewed, but you know. To choose the matrix randomly you have two options: the right way and the nut way. In the right way, the idea is to iterate for each…