Posts by clid saniny • 26 points
5 posts
-
1
votes3
answers1589
viewsA: How to read file line . txt from index 0
int main(void) { FILE *ficheiro = fopen("arquivo.txt", "r"); if(ficheiro == NULL){ printf("\nErro"); exit(1); } char linha[100]; while(fgets(linha, 100, ficheiro){ //essa função vai ler todo o…
-
0
votes2
answers879
viewsA: Pass matrix to C functions
Try putting it like that: void funcao(int **mat, int dim_linha, int dim_coluna); In which mat is a multidimensional vector, and you pass the dimension of the matrix…
-
0
votes2
answers3199
viewsA: How to return a char vector to a function in C? type as a pointer
The variable "vet" is of the pointer type, so you should return the same type. Ex: char **retornar_vetor(char **mensagem, char **vet){ . . . . return vet; } Upon receiving function value you should…
canswered clid saniny 26 -
0
votes1
answer360
viewsA: How to add values from one array to another inversely?
An example: int[] D = new int[] {1,2,3,4,5,6,7,8,9,10}; int[] E = new int[D.length]; int j = D.length - 1; for(int i = 0; i < D.length; i++){ E[j] = D[i]; // i começa em 0 e j começa em 9 j--; }…
javaanswered clid saniny 26 -
0
votes1
answer134
viewsA: How do I read and separate the save data separated by the period and comma and comma?
See an example here: Dados ficheiro: emilio silva ; 25 , 2 , 2017 carla patricia , 3 , 4 , 2016 Silvia Pereira ; 25 , 8 , 2015 Miguel Antonio, 7 , 8 , 2014 Code: int main(void){ FILE *fp =…
canswered clid saniny 26