Questions tagged as 'c'

1
answer

How to read .cap file with C?

I'm doing a small program in (C / C ++) to read some data from a .CAP file (provided by TCPDUMP). A good example would be WireShark, but I need far less INFO. It turns out, this .CAP seems to be written in HEXA and when I read the data it c...
asked by 11.09.2016 / 10:14
1
answer

Problem to create a linked list in C

Hello, I'm trying to create a linked list automatically, that is, it will be created inside a for . But for some reason I get the error segmentation fault, follow the code: no *lista, *cabeca; int n, r1, *r2; int i,j; cabeca = mall...
asked by 02.09.2016 / 20:47
1
answer

Enable variable spacing Code :: Blocks

I love Code :: Blocks, but it has a problem, I wanted it to already spill the instructions as soon as I put the ';' same as Visual Studio. Ex: for(int i=0;i<n;i++)'' >> ''for(int i = 0; i < n; i++)     
asked by 31.07.2016 / 14:44
1
answer

Function int (* cmp) (void *, void *)

I know that it compares pointers and returns an integer that determines whether one is smaller than another, in the order sense. But when I use it in main() , it is giving some error. Can you help me?     
asked by 29.06.2016 / 16:04
1
answer

Write a function within certain requirements

Can anyone help me with the exercise below? 1) Write a function called update, which has no return (void), which will have four input parameters: (a) a pointer / reference to a DATA type structure (see below), (b) day, (c) an integer called m...
asked by 09.08.2016 / 01:32
2
answers

Matrix in dynamic allocation with execution failure

Hello The following code has compiled but has an error executing: #include <stdlib.h> #include <stdio.h> #include <conio.h> typedef struct { char *nome; int valor; int peso; } objeto; objeto obj[] = { {"...
asked by 18.06.2016 / 05:06
1
answer

Problems with binary search tree in C

Now repositioning my post more clearly (this is a continuation of my previous question ). In the code, I try to create a binary search tree and insert elements into it. They should be saved in .txt file. As soon as I run it it says that .exe ha...
asked by 10.07.2016 / 19:13
1
answer

SIGSEGV error in using a pointer

I have the following problem: I'm creating a pointer and allocating memory in it, passing its reference to function, but when I read it in function the error occurs in the title. Function: void FileLer(char *texto, char *file) { //...
asked by 22.08.2016 / 15:48
1
answer

Question about arrays and pointer

#include <stdio.h> #include <locale.h> int main () { setlocale (LC_ALL,"Portuguese"); // Formatação. int notas1[50],notas2[50],notas3[50],soma[50]; // Declaração. for (int i = 1; i < 50; i++){ // Dados. prin...
asked by 09.06.2016 / 04:41
1
answer

Problem with scanf on% d receiving a keyboard letter

I have a problem, I am reading a int %d by scanf , but if the user types a letter the program enters loop . void chama_menu_switch(Fila **f, int n){ char confi; int i,y,x,a,z; double r; a = 0; int b; for (i = 0; z != 11; i++) {...
asked by 10.06.2016 / 02:53