Posts by poirot • 213 points
9 posts
-
4
votes1
answer161
viewsQ: Java Nullpointerexception Error
I have a class like User which has as attribute a vector of Sensors, and the class Sensors has as attribute a vector of Data. After creating five objects of type User and saving in a txt file, I…
-
5
votes2
answers1522
viewsQ: How to read data from txt files using Java?
Is there any mechanism to store the data of a file in a Linkedlist .txt? For example, how would this list have as elements the strings "Caio", "Pedro" and "Luiza"? import java.io.*; public class…
-
4
votes1
answer734
viewsQ: Error "illegal start of Expression"
In my main I’m calling the method stats: user.stats(ctr); The method stats in itself: public void stats (int num) { int i; float total=0, perc; for (i=0;i<num;i++) { total = total +…
-
0
votes1
answer54
viewsQ: Nullpointerexception error with class composition
I have a class called Users, which has as attribute an array of type Sensors protected Sensors sensors[10]; It also has the setDescription method public void setDescription (int ind, String…
-
0
votes1
answer29
viewsQ: Conversion error in c::b
I have a queue set like this: typedef struct nodo { int inf; struct nodo *next; }NODO; typedef struct { struct nodo *INICIO; struct nodo *FIM; }DESCRITOR; typedef DESCRITOR *FILA_ENC; And a function…
-
0
votes0
answers138
viewsQ: Colouring in pascal/C
I have the following coloring code of regions using queue in Pascal: program coloracao; uses crt, filas; const dim = 5; type imagem = array [0...dim+1, 0...dim+1] of integer; const I: imagem = ((-1,…
-
1
votes1
answer1882
viewsQ: Concatenation of two chained lists in C
Given the TAD LISTA_ENC_NC_ORD, need to implement an operation that takes two lists and returns a list resulting from the concatenation of them, and that cannot have elements with the same value.…
-
2
votes2
answers1206
viewsQ: ". exe has stopped working"
I have the following code: typedef struct { unsigned int ordem; int *elementos; }MAT_DIAG; void criar_matriz (MAT_DIAG *m, int d); void inicializar_matriz (MAT_DIAG *m); void imprimir_matriz…
-
4
votes2
answers260
viewsQ: Doubt about pointers
This code creates matrix, initializes and prints, as well as adding, subtracting and multiplying matrices: typedef struct{ int nl; int nc; int **elementos; }MATRIZ; void criar_matriz (int, int,…