Posts by SeventhBit • 143 points
8 posts
-
-2
votes1
answer248
viewsA: String in Struct - C Language
#include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> #define COCA_COLA_250 3.50 #define COCA_COLA_1000 8.00 #define FANTA_LARANJA_250 3.00 #define…
canswered SeventhBit 143 -
0
votes1
answer999
viewsA: Count lines and words from a C text file
Corrections: Inclusion of headings stdio.h, stdlib.h and string.h ssize_t -> size_t Removal of exit_on_null line[strlen(line) - 1] = '\0'; / -> line[strlen(line) - 1] = '\0'; And many others…
-
1
votes1
answer51
viewsA: ERROR WHEN GIVING CHAR PRINTF
The problem is here: emp3 lerData(int matricula, char nome) { emp3 c; c.matricula = matricula; c.nome[20] = nome; return c; } Change for: emp3 lerData(int matricula, char *nome) { emp3 c;…
canswered SeventhBit 143 -
4
votes1
answer58
viewsQ: String concatenation behavior in C
Why the following C code works? char *str = "A""B"; /* str = "AB" */ However I noticed that it is only in string statements, for example the following would not work: char *a = "A"; char *ab = a…
-
0
votes2
answers4555
viewsA: Prime numbers in C
Good is not more elegant code that exists ,but solves the problem well with a little recursion. Code #include <stdio.h> #include <stdbool.h> bool ePrimo(int n ,int nn); int main(void) {…
canswered SeventhBit 143 -
1
votes1
answer43
viewsA: Is it possible for a single button to change Imageview A to B, C, D... ? - Java/Android
As far as I understand it ,you want Imageview to act as a "slide show" by pressing a button. For this you can use the Timer and Timertask class as follows. Outside the onclick button create a Timer…
-
1
votes2
answers618
viewsA: Automatic IMC calculation in INPUT
Basically I made some corrections to your code mainly in Javascript. In your html I just changed the onfocus and onblur to onkeyup because from what I understand and analysis by code you want each…
javascriptanswered SeventhBit 143 -
1
votes3
answers347
viewsA: Return the oldest person from a list with tuples
Based on the conditions for the answer I implemented the solution to the problem. I believe that there is no need to explain the code because it is all commented on. But for any doubt ,I will be…