Questions tagged as 'c'

1
answer

Release memory from the node of a TRIE in C

I am with a problem for a project that I am doing in the subject Organization of Computers. In the program I have to create a TRIE structure that reads words from a file and counts the number of occurrences of each word. The TRIE nodes have an o...
asked by 05.10.2017 / 17:10
1
answer

What exactly performs the following return statement?

return *s && strchr(delimiter, *s); I have seen that it is used in javascript as an abbreviation of: if(param 1) return param2; else return param1; But it is not clear to me if its use is the same.     
asked by 21.09.2017 / 16:10
1
answer

Doubt C input flows

The following program works well for me in C ++ with its respective changes (cin and cout), however, when passing it to C, the input provided by the keyboard fails. #include <stdio.h> #include <stdlib.h> struct etapa{ int h,...
asked by 13.09.2017 / 16:27
1
answer

How can I apply an "if or while" condition to a "struct" struct fix in C? [closed]

I have this problem and in the code that gives us example structures are handled but from what I understand a structure can not be compared, what I want to do is compare if register 1 is greater than 18 then increase a counter and so on for the...
asked by 18.09.2017 / 04:15
1
answer

At the moment of showing the final data in C

Since I have a variable with stored data and I try to show it in a printf I do not get the data but a number that has nothing to do with it. totalcasados is variable integer (int). printf("Total de Casados: %d",&totalcasados); should...
asked by 18.09.2017 / 18:42
1
answer

Stack and queue in a linked list

I have done an exercise in which I enter data in a stack and in a queue, I sort the data from least to greatest and I visualize them in a linked list, the code I have works, but I think that something can be changed to improve it . Code: ty...
asked by 16.08.2017 / 09:31
1
answer

Does not take or print the declared array C

my problem is the following, I do not know why I do not take the matrix as I declare 3x3 take me and print as if it were a common arrangement, I hope you can help me. Thank you very much! int main() { int mat [3][3]; int i, x; pr...
asked by 28.06.2017 / 16:55
1
answer

Error: assignment makes integer from pointer without a cast,

I need your help with this small part of my program. I have to create a database of products in C language and one of the functions that we have to use is called "initializar.c", its purpose is to initialize the field "product" with '\ 0' (the n...
asked by 24.03.2018 / 20:09
1
answer

use threads and when compiling do not use -l pthread

Hi, I'm doing a program in linux with threads and when I compile I should use gcc .... -l pthread to work my question is how can I do so that I do not have to be putting the pthread always simply compile as gcc -or test test.c I hope you unde...
asked by 13.06.2017 / 06:30
1
answer

fopen does not work and SIGSEGV sends me in debug and another error in normal compilation

Basically I want to make a program that "divides" the routes in which the file is that I am specifying, that I already achieve, however I also want to access this file with everything and the route so I use fopen and place as variable the string...
asked by 28.05.2017 / 08:34