Posts by João Iora • 440 points
10 posts
-
0
votes5
answers5371
viewsA: Split a string with empty spaces
The function strtok ends up separating a string into "pieces", or tokens, according to some expression used. Function prototype: char* strtok(char* str, const char* delimiters); So a simple solution…
-
2
votes2
answers223
viewsA: Static constants
According to the link of the Oracle documentation, an enumerator has no more instances than those defined by its constants. In a reply in the English OS, each Enum class is compiled as subfloors of…
-
0
votes1
answer121
viewsA: How to change the size of a Jfilechooser?
Try chooser.setSize(new Dimension(x, y));. Substitute x and y for a value of your choice.
-
2
votes1
answer2069
views -
5
votes1
answer332
viewsQ: Problems with dynamic allocation
In an exercise I need to make a record of a struct possibly declared as follows:. typedef struct Locatarios { char nomeLocatario[MAX_NOME]; int codigoLoc; float valorAluguel; } Locatarios; It is…
-
1
votes1
answer250
viewsQ: Permission denied accessing file
I have a function in my program where it shows all students registered in a binary file, the user selects which one he wants to delete, a confirmation screen appears with the user’s data waiting for…
-
11
votes3
answers31819
viewsQ: Random number range in C
In a certain program, I need to generate a random value greater than 1000 (with a limit set by me to up to 5000 (maybe it’s still too high)). This unique code refers to a type of registration to be…
-
1
votes1
answer562
viewsQ: How to adjust the format dd/mm/yyyy
I have the following code that takes the instant date from the computer. #include <Windows.h> #include <stdio.h> #include <time.h> void main () { time_t t = time(NULL); struct tm…
-
8
votes1
answer7678
viewsQ: How to make a function within a function return a vector?
I have a job for my course, and it is necessary to make a program similar to the game of megasena. It’s almost done, but I’m finding a small problem and I need help. Job dice: maximum 10 players can…
-
1
votes1
answer2722
viewsQ: Scroll through a matrix and validate repeated numbers
I am doing a final work in the first semester of the BCC course and I need to do a Mega Sena algorithm with the following features: Maximum of 10 players Each player must bet a minimum of 6 numbers…