Questions tagged as 'c'

1
answer

How to store data in an array and that does not show null spaces?

I'm trying to store an "address" in a array with 150 spaces , this is stored in a txt document and the problem is that when I open the txt document the address shows me the spaces leftovers . The code is as follows: struct cliente{ ch...
asked by 17.03.2018 / 12:29
1
answer

Store information in an array and display it

I have a code about movies that have their types in which I try to store their information in an array. At the time of collecting the data I must be doing it wrong since when using the function to show the crashea movies. Sometimes I print...
asked by 15.04.2018 / 21:21
1
answer

Segmentation Fault when redirecting input, but it works when it is by console

I have the following code: #include <stdio.h> #define WLEN 32 /* word length */ #define LOGWLEN 50016 /* log word length -- round(LOG2(WLEN) */ #define SMAX 50016 /* maximum string length -- multiple of WLEN */ #define BI...
asked by 12.01.2018 / 18:19
1
answer

Use int and char in pipes in c

Can whole numbers (int) and characters (char) be transmitted for the same pipe or do you need to create two different pipes? How would it be?     
asked by 14.01.2018 / 11:45
1
answer

The pointer does not return the full value of the string

Hello, I have problems with this code that must convert an integer to binary and keep the zeros and ones in a pointer of type char. However after the execution the pointer only returns a 1 and not all the values of the string #include <stdi...
asked by 11.11.2017 / 19:37
1
answer

Save local time in a variable

I am trying to save the time of registration in a variable, for example, if the system registers a program execution at 3am I need to save it in a variable, but if I print the value of that variable at any other time, I always show me 3am int...
asked by 29.11.2017 / 01:19
1
answer

Error in conditional char in C language

I have a problem when trying to perform a conditional with a string, what I try is to ask the city first and depending on what the user writes, I do the conditional code, but it does not work, it takes me directly to else #include "stdi...
asked by 24.11.2017 / 01:35
1
answer

I want to assign an output to a menu made with a switch

I want option 5 to leave the menu this is the code #include<stdio.h> int a,n,i,j=0,k=0; int A [100]; int B [100]; int C [100]; int opc; int main() { do { do { printf("Selecciona una opcion: \n\n");...
asked by 06.10.2017 / 07:27
1
answer

execute C program from .bat file

What I want to know is if you can run a C program and give the program entries through the same .bat file for example a program that adds 2 numbers what I do in the code below is compile it and generate a. exe that is called add then in the foll...
asked by 23.10.2017 / 08:54
2
answers

Circular list doubly linked

This code tries to implement a double linked circular list The code compiles, does not throw an error, but gets stuck when trying to enter numbers #include <stdio.h> #include <conio.h> #include <windows.h> #include <std...
asked by 04.10.2017 / 18:54