Questions tagged as 'c'

1
answer

Accessing a pointer pointer (c)

Why when dropping a level on the pointer pointer ** lista / * lista we should use the parentheses: ( * lista ) , I ask the question because I saw in some internet examples that they did not use and also in an old book that I...
asked by 17.04.2017 / 23:04
1
answer

Modify = 2D array using pointers

I would like to modify my array (multiplying by 2 each of its elements) using pointers, but I do not know why my code is not working ... #include<stdio.h> void changematrix(int **mm,int row, int column) { int i,j; for( i = 0;i &...
asked by 18.04.2017 / 06:21
1
answer

Error when trying to get data from a .txt file and move to a queue in C?

I can open and move through the file the error happens when I try to point to the beginning or end of the queue, someone tell me if the pointers are correct typedef struct lista { int info; char infoP; struct lista* prox; }Lista; typedef stru...
asked by 11.04.2017 / 20:51
1
answer

How to execute a .bat file from an algorithm in C?

I would like to know how I could execute an external file (a .bat, for example) from an algorithm in C.     
asked by 22.04.2017 / 00:21
1
answer

Count left tree function

This function below compiles correctly, it works. int qtd_niveis (tipo_arvore * raiz) { if (raiz == NULL) return 0; int esquerda = qtd_niveis(raiz -> esq); int direita = qtd_niveis(raiz -> dir); if (esquerda > direita) return...
asked by 17.05.2017 / 14:28
1
answer

Malloc does not work in C code

When trying to compile the code I get the following error messages: #include<stdio.h>#include<stdlib.h>#defineOK0voidpreencherVetor(int*vetor[],inttamanho){intindice;for(indice=0;indice<tamanho;indice++){printf("Entre com o va...
asked by 16.05.2017 / 22:07
1
answer

Lvalue required as left operand of assignment

I get this error    lvalue required as left operand of assignment in the code if (a*a = b*b + c*c) { printf ("TRIANGULO RETANGULO\n");}     
asked by 18.05.2017 / 00:39
1
answer

Switch command running even without being called - C

I am solving a logic exercise and I can not understand the error: #include <stdio.h> #include <stdlib.h> int main(){ int TotalVinhos=0, t=0, b=0, r=0, fim = 0; //float Porc; char tipo; while(fim == 0){ printf("Tipo do vinho: ")...
asked by 13.05.2017 / 21:45
1
answer

Error: "error: array type 'int [oversize]' is not assignable"

When trying to compile the program I get the following message:    error: array type 'int [oversize]' is not assignable       majorVetor = vectorII;       ~~~~~~~~ ^       error: array type 'int [oversize]' is not assignable       majorVe...
asked by 15.05.2017 / 21:46
1
answer

I am not able to save data in the file it creates the file but only it does not store anything [closed]

void Criar_Ficheiro_Pizza() { FILE *B; if ((B = fopen("Pizzas.txt", "a")) == NULL) printf("\n\t !!! Ficheiro nao pode ser guardado!!!"); else { pizzas *aux; while(aux!=NULL) { fprintf(B,"%d\...
asked by 31.03.2017 / 22:41