Questions tagged as 'c'

1
answer

Linker does not link

I'm trying to compile a package; specifically, the plugin gkrellm-leds for gkrellm . I downloaded the sources from packages.ubuntu.com/source/zesty/gkrellm-leds . After compiling and installing it, it does not work. The progra...
asked by 29.05.2017 / 07:52
3
answers

How to read strings of a structure passed by reference

This is my Structure typedef struct{ char Nombre[20]; }Cliente; And they ask me for a function that captures the name by means of the structure and performs this function void Captura_cliente(Cliente *client){ printf("Escriba...
asked by 20.12.2018 / 10:19
2
answers

System calls with files

I have a code whose mission is to copy a source to a destination. The point is that, when compiling, it warns me that on line 38 an assignment is made from an integer to a pointer without a molding and I do not know how to fix it. Also, runni...
asked by 21.03.2016 / 18:58
1
answer

Sum of two integers by inline asm in C

This is my code, I'm running it with gcc on linux, I try to save the result of 3 + 5 in the variable c, and display it on the screen: #include<stdio.h> int main(){ double c; __asm__ ("movw $0x05,%ax"); __asm__("movw $0x0...
asked by 10.01.2018 / 18:58
1
answer

Files: functions vs. system calls

I have two questions related to the I / O file: What is faster to access a file (if one is better), C functions ( fopen , fprintf , fseek , etc.) or calls to UNIX ( open , write , lseek , etc.)? How c...
asked by 23.02.2018 / 09:34
2
answers

c ++ - Preprocessor - Existential doubt

I really have a doubt in existence, and as I go on it makes me more noisy and I really do not know if I'm doing things right. I have my own software, which I developed a few months ago ... it goes quite well in its purpose, but it turns out that...
asked by 27.11.2018 / 15:23
2
answers

Declare an array with a length entered by the user

Suppose I put 10 in the length of the vectors in the following code. The problem is that even if I put 10 in the length, I can only enter 6 coordinates to the vector using the keyboard. Why does that problem happen? int...
asked by 28.04.2018 / 06:25
1
answer

Random number of 0 and 1 in C

I need to generate a random number of 0's and 1's in C. Try to make two variables with random numbers, that of 0's and 1's, and the other so that it is the limit of a cycle that is executed to generate those 0's and 1's. I hope someone can help...
asked by 13.09.2017 / 01:51
2
answers

How to access a structure within another structure

I have the following example code in which I try to insert a structure into another, but then I do not know how to access its fields. #include <stdio.h> #include <stdlib.h> typedef struct Ejemplo{ void* data; } ejemplo; typed...
asked by 20.03.2017 / 16:40
1
answer

how to return a string in c

I'm doing a function to capture a string of alphanumeric and numeric characters I've seen several ways to be able to take the string back but I do not get it I leave my code if someone could tell me what I'm doing wrong. #include <stdio....
asked by 19.07.2017 / 16:56