Posts by capaci • 108 points
9 posts
-
0
votes1
answer60
viewsA: Read quantity until you reach -1
What is happening is that you read the numbers and, after the -1 is found, exit the while. At that moment, your x is worth 0 and does not fall within the if, so your code ends. The exercise calls…
-
2
votes1
answer128
viewsA: Trying to build a graph
You stated V as a int but read it as a long, it would be right to read as a whole (scanf("%d", &V)) or declare V as a long (long V;) Another point, you will probably have problems like…
-
1
votes1
answer144
viewsA: Laravel route accessible by two types of user
You can pass your roles separated by comma and update the middleware to receive the parameters correctly. Route::get('{id}/cities', 'ApiControllers\StateController@cities')…
-
0
votes1
answer90
viewsA: Binary search tree in C
Just add as much data as you want into that struct. For example: struct No { int id; char nome[64]; struct No *left; struct No *right; }; typedef struct No No;…
-
0
votes1
answer495
viewsA: How to center a form vertically and horizontally with responsiveness using bootstrap?
You must use the classes align-items-center, to align vertically, and justify-content-center to align horizontally, in your div that has the class row. It’s going to be something like: <div…
-
2
votes2
answers42
viewsA: SQL formatting field
You can use the FORMAT function. SELECT FORMAT(valor, '000000') FROM tabela; References: Mysql: https://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_format SQL Server:…
-
0
votes1
answer778
viewsA: Open file in C
In fact, using the fopen, you will have a pointer to the file, so you can work with the contents of that file (read and write to the file, for example). If you want to open the file with the default…
-
0
votes1
answer378
viewsA: Typeerror: Cannot read Property 'map' of Undefined
The error is on the line $scope.dTableOptions.aaData = data.Lista.map(it => {. Probably the List attribute, which is returned from your request, does not exist. The method map is a property of…
-
1
votes2
answers790
viewsA: How do I sort a given array object in alphabetical order?
Taking a look at your code, what you can do is use the method addEventListener to perform its function again showPokemon every time the select is amended. Then you can take the value of the select…