Questions tagged as 'c'

2
answers

".exe has stopped working"

I have the following code: typedef struct { unsigned int ordem; int *elementos; }MAT_DIAG; void criar_matriz (MAT_DIAG *m, int d); void inicializar_matriz (MAT_DIAG *m); void imprimir_matriz (MAT_DIAG *m); int retornar_elemento_matr...
asked by 18.03.2015 / 00:14
1
answer

Pass array as function parameter?

I am studying the Dijkstra algorithm and have not yet tried to use adjacency list. I knew I could solve the problem with an array, but the fact is that I can not get the array in the function. If I put the code direct in main it works as...
asked by 25.04.2015 / 03:37
1
answer

About the inclusion of headers (.h) and the proper compilation

Assuming I create a .h file for the specification of a function func.h #ifndef FUNC_H #define FUNC_H int xPy(int x, int y); #endif //FUNC_H Then I created the implementation of this function in a .c file, like: func.c...
asked by 01.01.2019 / 21:01
2
answers

Library "Windows.h" or what allows me to perform?

I'm starting in the C language and would like to know what the "Windows.h" library matches ?! she's responsible for what ?! What kind of functions does it allow me?!     
asked by 20.05.2014 / 23:44
1
answer

Compare Strings with Struct Vector in C

I'm trying to do a search on a struct vector to return a list from the variable sex, but at the time of string comparison the list is not returned. full code: PASTEBIN void consultar_registro() { struct pessoas p[5]; int...
asked by 27.10.2018 / 23:19
1
answer

Error in program C (calculation of determinants)

#include <stdio.h> #include <math.h> void zerar(int n,int m[][n]) { int i, j; for (i=0; i<n; i++) { for (j=0; j<n; j++) { m[i][j] = 0; } } } void printm(int n, int matriz[][n]) { int...
asked by 04.11.2015 / 03:20
1
answer

Problems with union of 2 vectors

I have a problem to join two sets of integers into a vector, without repeating numbers that are in Set A and Set B. The following error is displayed in line 13:    error: unknown type name 'bool'; did you mean '_Bool'? | Changing bool...
asked by 16.11.2018 / 07:19
2
answers

Dynamic allocation for struct

I need to dynamically allocate space for a structure, but I'm not getting it and I do not know my error is at the time of the declaration or allocation, follow the functions consistent with the declaration. Statement struct { char nome[...
asked by 25.11.2014 / 00:00
1
answer

Error in recursion logic

My recursive function needs to calculate the power of high b to N is giving error of "Segmentation fault (recorded core image)", what can be? My role: int potencia(int b, int n, int a){ if(n == 0){ return b; } b=b*a; return p...
asked by 28.06.2018 / 18:43
1
answer

Output condition in do-while in C code

I need the user to enter the numbers 1, 2 or 3 to choose the locations, and if not select one, ask again. However, when you enter the number 0 or 4, for example, it returns to the home screen (which would be the menu of destinations, costs an...
asked by 24.06.2018 / 23:36