Questions tagged as 'c'

1
answer

Insert sublist into list C

Hello, I'm having trouble working with linked sublists. I would like to know the correct way to insert a sublist into a list. I declare the lists as follows: struct Casa { int id_consumidor; int casa; float consumo; char *nom...
asked by 19.04.2015 / 17:12
2
answers

save a data type to a file in c language

I have this data structure: typedef struct { ListaCartao tabelaCartao[HASHSIZE]; ListaArtigos tabelaArtigos[HASHSIZE]; char localidade[MAXLOCALIZACAO]; }tCelulaSuperdume, *SuperDume; SuperDume superMercadoLocal[CONJUNTOSUPERDUME];...
asked by 09.05.2015 / 03:58
1
answer

How to read the last 3 characters of a char with no set size

I have a C application where I need to read only the last 3 characters of a char. Since the size of this char may vary, I did the following: memcpy(valor_final, string_total[strlen(string_total - 3)], 3); where valor_final wil...
asked by 09.06.2015 / 13:18
1
answer

Error in a function check

I need to make a code with several specific functions. In one, with a square matrix, I need to draw a primary and a secondary line, both cutting diagonally in the middle, leaving the upper numbers to be analyzed. Example: A 3 by 3 array would cu...
asked by 07.04.2015 / 05:07
1
answer

Copy struct C

How do I copy a pointer of type struct to C? For example, to copy a simple struct is only struct1 = struct2 ; but when it comes to 2 pointers, when it does this, one points to the same location of the other, and then the same, th...
asked by 26.03.2015 / 15:05
1
answer

Why, within the function, the program is not comparing correctly?

The program receives the number of questions, the number of students, creates a vector of type char for the template and compares with the result of the other students, in an array, but within the function of contagemvalores , apparently t...
asked by 07.06.2015 / 03:03
1
answer

Help in genealogical tree in C

Good afternoon, I need to build a genealogical tree in c, but I only find examples with numbers that are compared, and if it is smaller than the previous one, it is thrown to the left, but my doubt is that I need to build a tree with String. Bel...
asked by 08.06.2015 / 19:13
1
answer

How to compile and run C program using Sublime Text in Ubuntu 12.04?

Is it possible to configure Sublime Text 2 so that it compiles a code in C and then execute and show the result in the terminal?     
asked by 21.03.2015 / 06:55
1
answer

Problem with delta0 output

Good evening, I'm having trouble with the output of my program that printed on the screen the roots of the equation of the second degree. When I go to the condition of: if (delta<0) //Condicao caso o delta seja menor que zero { printf...
asked by 23.03.2015 / 01:11
1
answer

Error when I try to call a function

I need to calculate the distance between two points, but when I call the function that does this (calculates the distance), it gives the error: "subscripted value is neither array nor pointer nor vector". I did the same thing in another funct...
asked by 07.12.2014 / 22:23