Posts by Nexus • 420 points
10 posts
-
0
votes1
answer235
viewsA: Code problems from a C priority list
In LISTA lista[DIM],pt; you are creating pt as a variable LISTA, and not as a pointer for a variable LISTA. That’s why you can’t pass lista[objeto].prox for pt, because prox is a pointer and pt is…
-
0
votes1
answer555
viewsA: Error >> TESTE500K.c:(.text+0x8f): Undefined Reference to `INSERT' <<
After else { return 0; } there should be one more key, which would close the function main(). Without the key, you’re basically setting the functions IMPRIME() and INSERE() inside main(), which is…
-
3
votes1
answer483
viewsA: How to correctly divide a number to only one digit in C?
Using Strings Knowing that the maximum value for integers that most computers currently support is up to 19 digits, I will use a 20-digit string to perform this operation. #include <string.h>…
-
0
votes1
answer2257
viewsA: PROBLEM WITH FGETS IN C
How To Solve This problem is caused by the very functioning of scanf. To solve it, just modify this code snippet: scanf("%d", &dados->mm_prec); printf("Qual nome?");…
-
1
votes2
answers806
viewsQ: What is the usefulness of auto keyword in C?
To keyword auto, defined by the language C, is a keyword old and seemingly useless in the language. I know that in C its function is to define that it should be stored in stack as a local variable…
-
0
votes2
answers71
viewsA: Insert linked list node
void inserir_inicio(tipo_lista *p, tipo_lista *novo_no){ novo_no->prox = &(*p); *p = *novo_no; } It seems to me, you forgot to do the dereferencing pointer p. One of the ways I like to…
-
3
votes1
answer5279
viewsA: Delete line from a C file
Very interesting question! One can do the following: #include <stdio.h> #include <stdlib.h> #include <string.h> #define ARQUIVO_ESCOLHIDO 1 #define LINHA_DO_ARQUIVO 2 int main(int…
-
5
votes2
answers22927
viewsA: What is the meaning of the "&" (commercial) operator in the C language?
The operator & extracts the memory address of a certain variable, which can be used for a wide variety of things. Examples: Suppose you want to create a function that adds an integer x to an…
-
2
votes3
answers524
viewsA: include library in C is required?
Briefly, the macro #include copies the entire contents of a header file to another header file or source file. Many people confuse the standard C files with the C language itself, and this is a…
-
2
votes1
answer137
viewsA: Allegro Debug -Abort() Has Been Called
The first error is in the inclusion of the Allegro 5 files: #include <allegro5\allegro.h> #include <allegro5\allegro_native_dialog.h> #include <allegro5/allegro_image.h> You are…