Posts by Mateus -- O Schroeder • 391 points
13 posts
-
2
votes1
answer168
viewsA: Program in C closing without explanation
According to @Isac You’re making the fscanf wrong. They should stay that way: fscanf(arq1, "%s", nomeproduto[j]); fscanf(arq1, "%d", &quantida[j]); fscanf(arq1, "%d", &preco[j]);…
-
3
votes2
answers439
viewsA: Size of type int with short and long prefixes in C
For portability that question already talks a little about, where @Maniero responds: Defined behaviour In fact most behaviors are defined by the specification and for an implementation conform to…
-
2
votes1
answer55
viewsQ: When to use "rsize_t" instead of "size_t"?
What’s the difference between rsize_t and size_t, looking in the draft I found in the item K.3.6 General Utilities : rsize_t which is the type size_t; which means they’re the same type, but I…
-
3
votes2
answers242
viewsA: Function in C that deletes a given string
Erase, there’s no way. There is no way to make the variables in the positions you want, for example at position 6,7,8 simply cease to exist, what you can do is identify where it occurs s2 (in this…
-
3
votes1
answer61
viewsQ: Do vectors and structures always have continuous addresses?
Why vectors and structures are continuous in memory? I believe that it is not just coincidence. #include <stdio.h> int main(void){ char s[10]; for (int i=0; i<10; i++) printf("%d=%p.\n", i,…
-
0
votes3
answers82
viewsA: I’m not displaying the multiple correctly
He finds the value 49when num1 == 1, I mean, the first iteration. On the website you referenced: THEHUXLEY does not require that it be necessary num1 <= num2, as @Adir Kuhn pointed out #include…
-
3
votes2
answers626
viewsQ: Ways to initialize struct’s
I know these two ways to boot struct's. #include <stdio.h> typedef struct { char s[10]; int a, b; double x; } TIPO; int main(){ TIPO v1[10]={"foo", 5, 13, 4.3, "bar", 0, 0, 2.3}; TIPO…
-
0
votes2
answers100
viewsQ: Identify the amount and value of arguments received in a script
How to identify the amount of arguments I received in a Bash script? How can I get past values?
-
2
votes2
answers293
viewsA: Putting date and time in a backup in file . sh
Removing the formatting specifiers from manpage of date. FORMAT controls the output. Interpreted sequences are: %F full date; same as %Y-%m-%d %H hour (00..23) %M minute (00..59) %S second (00..60)…
-
1
votes1
answer131
viewsQ: What is the name given to an unsigned "overflow"?
Considering that answer in Soen would like to know what the nomenclature of when it occurs to try to store a value greater than the type unsigned int can contain as the result will be module…
-
1
votes1
answer126
viewsA: How can I store token values in an array?
Do you agree that token is a variable of the type char *? To store this tipo de dado simply state a vector of char *, note that hence this pointer vector which you will declare will serve to store…
-
1
votes2
answers109
viewsA: C Programming - Two-Dimensional Matrices
The problem is in you declaring nlinhas[] while you probably didn’t want a vector, and you need to declare the variable matriz[nlinhas][mcolunas] after you already own the values nlinhas and…
-
0
votes3
answers1916
viewsA: Find WHOLE word in a C string
A meneira to do is using Strtok(): http://www.cplusplus.com/reference/cstring/strtok/. One should only be careful with the use of this function because it modifies the string it takes as argument.…
canswered Mateus -- O Schroeder 391