Questions tagged as 'c'

1
answer

URI Problem 1061

Hello everyone, I am using a website to try to make a programming request. link I'm in Exercise 1061: link WhenIsendmycode,itsaysthatithas30%error,couldanyonehelpme?code:#include<stdio.h>intmain(){intW,X,Y,Z,d1,h1,m1,s1,d2,h2,m2...
asked by 13.03.2016 / 23:23
1
answer

C file manipulation (skip lines)

Hello, I have a problem with skipping lines in a file, I use fgets (), but it always prints the first line of my file. Home I also did some tests, and for some reason, only one iteration occurs and x enters the if with the value of random. Home N...
asked by 10.03.2016 / 21:12
1
answer

Segmentation fault function fgets

I'm having a segmentation fault problem opening txt files. I know for handling strings , higher level links, however I can not learn now, so I'm using C . My problem is to read a list with four thousand files name, whos...
asked by 26.01.2016 / 18:16
1
answer

Algorithm that sorts the elements of a dataset

"A team needs to write an algorithm that sorts the elements of a data set from a given criterion defined by the function. Knowing that the data set does not have an amount greater than 100 elements and that the team you do not have enough experi...
asked by 20.02.2016 / 18:54
1
answer

Segmentation fault (core dumped)

There is something wrong with the pointer in this program, whose purpose is to test a function that counts the number of characters in a string. For some reason he can not gain access to the memory to which he points. For this program I created...
asked by 21.03.2016 / 00:34
1
answer

Error collecting value from va_list in C

Good afternoon. I encountered a problem when preparing va_list in c. of two similar codes, one works and the other persists in error. extern bool _sqlite3_insert(const char *table, const char *types, ...){ M_HEADER; // macro com as...
asked by 19.02.2016 / 20:57
1
answer

How to use .h files in c language?

I would like to know what is the most recommended use of *.h files? Well I do not know if I can use them just to put the prototype functions or the function completely.     
asked by 21.02.2016 / 02:04
1
answer

Why can not I change the string this way?

When we have an int variable declared, and then a pointer to that variable: int x = 10; int *p = &x; To modify the variable x through the pointer, we have to do: *p = 20; However, when I declare: char *string = "ABCD"; And I t...
asked by 08.12.2015 / 17:21
1
answer

Use of pointers

I need to use pointers, but I do not understand how to express the syntax, it is part of the purpose of the task (change the value of the parameters passed by reference to the functions, such that these variables are printed in main ()). > #in...
asked by 16.11.2015 / 02:50
1
answer

Access memory allocated on a pointer

If I have a vector of pointers of type *p[tamanho] , where each position will be occupied by p[tamanho] = malloc(10*sizeof(int)) , how do I access each position of that vector allocated with malloc ?     
asked by 26.10.2015 / 04:53