Posts by Brumazzi DB • 4,345 points
175 posts
-
1
votes1
answer561
viewsA: Button to download HTML form
Using the broswer’s own Apis makes it easier to release the pdf. <!doctype html> <html> <head> <style> @media print{ /*Estilo da impressão*/ } </style> <script>…
-
1
votes1
answer349
viewsA: How do I create a list of arrangements to save a struct?
That code should help you. #include <stdio.h> #include <malloc.h> struct activity{ int id; int phone; char prio[20]; }; typedef struct _list{ // Armazena data struct activity *data;…
canswered Brumazzi DB 4,345 -
3
votes2
answers509
viewsA: How to change one variable without changing the other?
The method slice, make a copy of the vector for you, generating 2 independent vectors. var vector1 = [0,1,2,3,4,5]; var vector2 = vector1.slice(); vector2.pop(); alert(""+vector1.length+" :…
javascriptanswered Brumazzi DB 4,345 -
0
votes2
answers390
viewsA: Use of EOF in vectors
The EOF is only used for when dealing with files, just as the name already says End Of File, end of file, not vector. Starting with your while, the scanf is a method for reading information and the…
canswered Brumazzi DB 4,345 -
2
votes2
answers2039
viewsA: Function to draw a rectangle in the Console in C
If you are in Windows you can use the conio library. h #include <conio.h> #include <stdio.h> void draw_button(int x, int y, int w, int h, const int color){ int i,j; for(i=0;i<w;i++)…
canswered Brumazzi DB 4,345 -
2
votes1
answer385
viewsA: Pass values to a struct
Oh guys, I managed to solve the problem, I’ll leave the code in case someone needs one of these days #include <stdio.h> #include <malloc.h> #include <string.h> typedef struct…
-
0
votes1
answer385
viewsQ: Pass values to a struct
Good afternoon. I am in doubt whether it is possible to pass values to a C struct using JSON, Hibernate or some other known method?
-
0
votes2
answers1797
viewsA: Store values of a string in an array
If the values you have to collect are only integers, you can do so: ... int *y; int x,i; if(scanf("%i", &x); != -1){ y = (int *) malloc(sizeof(int)); // Aloca um tamanho para y…
canswered Brumazzi DB 4,345 -
3
votes2
answers13508
viewsA: How to pass numbers to alphabet letters
As well as all language, the javascript can also work with numeric character values, of course not as well as in C and C++. First, you need to be aware that values from 1 to 26 cannot become…
-
0
votes5
answers5371
viewsA: Split a string with empty spaces
The Strtok method, serves to break a string, after passing its string once per parameter, just put NULL ou 0 in the first parameter, the method will return the parts of the string. Use string.h char…
-
2
votes1
answer5307
viewsA: Space in a String C
the scanf accepts several different structures to perform input values, and to capture an entire line, you must use a structure that reads up to a specific character. char line[500];…
-
2
votes1
answer317
viewsA: Function with pointer to pointer
The call that of the method insertAVL_TreeR is wrong, the Node parameter is a double pointer, which would be its variable AVL_TreeNode **p. and when calling the method, you send as parameter the…
-
1
votes3
answers272
viewsA: Use of increments in C
The increment has the variation for each case you want to use. ex: int x = 10; int y = 10; printf("%i",x++); // imprime 10 printf("%i",x); // imprime 11 printf("%i",++y); // imprime 11…
canswered Brumazzi DB 4,345 -
1
votes2
answers799
viewsA: Typeerror - 'int' Object has no attribute '__getitem__' when iterating over list
the getitem is a method that every python object has so that you can make dynamic method calls and collect attributes through a string. Ex. >> to_upper = "string" >>…
-
0
votes2
answers211
viewsA: Create chained list with realloc()
when you take the position of a pointer it ceases to be a pointer. ex: lista *l; for(in=0;i<n;i++) puts(l[i]->nome); // isso vai dar erro puts(l[i].nome); // isso não vai dar erro or lista…
-
2
votes1
answer10254
viewsA: How to use . h files in c language?
Most . h files serve only to reference a method that is in a . c, . a , . so, . o or . dll, plus it doesn’t stop you from putting the features inside them, it’s just not semantically correct. an…
canswered Brumazzi DB 4,345 -
2
votes1
answer900
viewsA: The program is not reading the matrix numbers
When you leave the scanf("%d",&l) the code is storing line break buffer and skips the scanf("%c",T), I mean, it jumps right into the scanf("%f", &M[][]) inside the is, then when you enter an…
-
1
votes1
answer31
viewsQ: Error collecting va_list value in C
Good afternoon. I came across a problem at the time of preparing the va_list in c. of two similar codes, one works and the other persists in error. extern bool _sqlite3_insert(const char *table,…
-
2
votes2
answers761
viewsA: How to debug programs in C by Command Prompt?
A great program for debugging C codes is gdb, and to be able to debug the code, you need to compile it with the -g parameter, which compiles the code and creates a binary file for debug. When…
-
1
votes1
answer49
viewsA: Keeping names
You can use a list structure to add as many names as you want. typedef struct __list__{ const char *name; struct __list__ *next; }list; // Estrutura de linked list void list_insert(list **l, const…
-
0
votes2
answers331
viewsA: I cannot enter user-defined values in Sqlite
a way to be passing the values to your very useful sql that always works, is using the passage of parameters by tuples. c.execute("INSERT INTO products (name,description,costp,sellp) VALUES…
-
2
votes2
answers1283
viewsA: SELECT 3 different tables using DAPPER?
If you just want to query the data without doing any processing of the information before returning, I think the best thing to do is to use the inner join, because this way the information of the…
-
2
votes1
answer42
viewsQ: Error in sqlite3 Foreign or foreigin
I created a database on sqlite3 in version 3.9.2 and had problems with Foreign key. alter table table_01 add column tab_2 integer foreign key references table_02(id); // Esse deu erro de sintaxe no…
sqlite3asked Brumazzi DB 4,345 -
0
votes2
answers417
viewsA: Use of the GREP Function
Uses that function. CEP=$(echo $endereco_completo | TR "\[" "\n" | grep ']' | cut -c1-8) Pay attention to the quotation marks, because it can be a mistake if the grep is " or winter '.…
-
1
votes1
answer1115
viewsQ: Problem with split function in C
Hi, I’m studying the C language and came across a pointer problem in a string breaking function. I use the version GCC 4.8.4. The error value is "1234|123|123|123|123" 4/3/3/3, while other values…