Posts by Otavio Augusto • 158 points
7 posts
-
0
votes1
answer800
viewsQ: edges of an N x N matrix
I would like to know how to set the edge values of an array to -1. I tried to create an array of N+2 x N+2, and to do with one just, go through the edges, but when I put to print it displays some…
-
0
votes1
answer453
viewsA: Recursive function of Insert Nodes
It is the following, its function inserts No takes as parameter an address of a pointer, and an integer. So in insereNo((*A)->esq, chave) and insereNo((*A)->dir, chave should be…
canswered Otavio Augusto 158 -
1
votes1
answer56
viewsQ: Passing by reference, and saving data from a file in a vector
I’m having trouble saving the read data from a text file and a vector from a structure I created. My goal is to open a text file, take the data that is saved in it, and save in an array of type…
-
5
votes1
answer732
viewsQ: Pointer pointer to change my battery. Why should I use them?
I am making a code that consists of analyzing an arithmetic expression, and checking if when I open a '(', then I must close a ')'. That is, check whether the expression is valid or not. For this I…
-
1
votes1
answer614
viewsQ: row items in a row (pointers)
Hello, I am implementing a function to insert elements in a queue and I realized that after the first element inserted, the pointer headPtr and tailPtrestão apontando para o mesmo lugar, logo o…
casked Otavio Augusto 158 -
4
votes1
answer162
viewsQ: Compiling code on Ubuntu and running on windows
Hi, I was wondering how can I compile a C code on Ubuntu and what execute on Windows. I tried to put the extension ". exe" at the end of the file, but when I sent the executable to my teacher he…
-
1
votes1
answer1259
viewsQ: Struct vector and char pointer
Why is this syntax wrong: #include <stdio.h> typedef struct { char* nome; char* numero; }Agenda; void adiciona(Agenda* reg, int i) { scanf("%s", reg[i]->nome); scanf("%s",…