Posts by user48571 • 79 points
8 posts
-
0
votes1
answer671
viewsQ: Sort matrix of n rows using the column value in C as a criterion
I have the following code : int** ordena(int **v, int tam) { int i, j,aux; int swap[3]; for (i = 0; i > (tam-1); i++){ aux = i; for (j = (i+1); j > tam; j++) { if(v[j][1] > v[aux][1]) { aux…
-
1
votes1
answer408
views -
2
votes1
answer82
viewsQ: How to pass values via terminal to a program function
#include <stdio.h> #include <string.h> void soma(int a,int b); int main(int argc,char *argv[]) { printf("A soma="); return 0; } void soma(int a,int b){ printf("%d\n",a+b); } As step the…
-
1
votes2
answers668
viewsQ: Assign values to a variable
I have the following program: #include <stdio.h> int a,b; int main(int argc,char *argv[]){ int c; printf("%d",a+b); printf("%d",c); return 0; } How do I pass a value to the global or local…
-
0
votes1
answer82
viewsQ: How to omit space to insert only numbers in different lists
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct NBIG{ int numero; struct NBIG *nseg; struct NBIG *nant; }Nbig; int main(int argc,char *argv[]) { char…
-
0
votes1
answer281
viewsQ: Read end file to start
.... fseek(arq, 0, SEEK_END); while(!feof(arq)){ //fgets(&ch,2,arq); fread(&ch, sizeof(char), 1, arq); //printf("\n%c",ch); num = atoi(&ch); vem=makenode(); vem->numero=num;…
-
-1
votes1
answer453
viewsQ: How to read an integer with no limit of digits in C
It has some way of reading an integer from the keyboard without limit control of digits. Like I need to pass a giant number via keyboard to a variable and then pass all the digits of that number to…
-
2
votes2
answers133
viewsQ: Any difference between the two expressions?
int p=4,u=12; System.out.println(p=u); System.out.println(p=+u); I don’t understand the difference between the two expressions?