Posts by chriptus13 • 218 points
10 posts
-
0
votes1
answer29
viewsA: Segmentation fault error when printing 2D array - loop is not sending values to array
The problem is not defining the size of the first dimension of the array compra as you are initializing the same it will only have room for one purchase. You have two choices either indicate a size…
-
1
votes2
answers165
viewsA: "setState" problem using React
The problem is that you need to return a new object with the property changed. In React you should not directly manipulate the state you should calculate a new state based on the current one. Try…
-
0
votes1
answer47
viewsA: Gift format text converter for Java language Moodle
If I understood what you wanted try this. List<String> giftFormat = //... for (int i = 0; i < giftFormat.size(); i++) { String linha = giftFormat.get(i); if (i == 0) giftFormat.set(i, linha…
javaanswered chriptus13 218 -
0
votes1
answer35
viewsA: inventory system - dynamically change input value
You gotta get the value of the element x every call of the function aviso. <!DOCTYPE html> <html> <head> <title>teste</title> <meta charset="UTF-8"> <script…
javascriptanswered chriptus13 218 -
0
votes2
answers758
viewsA: Doubt in c (chained and vector lists)
With a linked list values are traversed through the fields prox. typedef struct info { int num; struct info *prox; } Info; int main(void) { Info *info1, *info2; info1 = (Info *)…
canswered chriptus13 218 -
0
votes1
answer101
viewsA: How to capture a json field in java?
The problem is using one JSONObject just instead of using JSONArray as you receive an array and not just an object. By changing the code you get the following. public static void main(String[] args)…
-
0
votes1
answer37
viewsA: C# Lambda for Java Lambda
In principle it will be any of the kind, assuming that the GameFiles is a list of filenames. You need to see the condition of Where that in Java is filter and mapping through the map. In the end I…
-
0
votes2
answers280
viewsA: Infinite loop when reading integers with Scanner
The "infinite loop" happens once the method Scanner::nextInt does not consume the input which generated the error, hence the buffer shall remain with what is written until it is consumed. Thus,…
-
0
votes1
answer126
viewsA: Drawing of positions of a matrix
Uses the class java.util. and then something like this: void fillRandomPositions(int[][] arr, int n, int positions) { Random rnd = new Random(); for(int i=0; i<positions; i++)…
-
6
votes1
answer87
viewsQ: Symbols in compilation time
When compiling only with -c and when displaying the symbols with $nm ficheiro.o, what the symbol means C and which section is assigned to it? I have read that it means that the symbol is common and…