Questions tagged as 'c'

1
answer

How to make a pointer by reference in C

Well what I said in C ++ compiles this code for me without problems: void pasoPorReferencia(int *&referencia){ cout<<referencia<<endl; int *dir_cambio, m = 2; dir_cambio = &m; cout<<dir_...
asked by 16.09.2017 / 16:02
2
answers

C file logs with list

I'm doing a file practice with a Person list that has a name and age. My problem is that when I run for the first time I can register and read in the file, but when I close and run again and I want to read the records again, the program crashes,...
asked by 06.07.2016 / 22:16
1
answer

Modify node in C

I have this function to modify a node, but when I use it, it modifies the node I asked for but deletes the others. How can I change it and not delete the other nodes? _nodoActividades *modificarActividades(_nodoActividades *apuntador) {...
asked by 02.12.2016 / 07:23
1
answer

Formatters in C

Hello I was looking at wikipedia the "Formatters" and I hit this code, it is assumed that what I put after the% and before the d will vary the result, but in all cases I printed the complete number 1234 . What are the values that I use for? than...
asked by 13.02.2017 / 16:59
1
answer

Segmentation fault FILE

When I try to make a ftell from my pointer to FILE 'em' (employees) in the function 'createTablekeyEmployee (fpEmployee, tableKey);' a segmentation error is created, but the code has been revised and it appears in the functions of Creation and o...
asked by 18.09.2016 / 15:26
5
answers

PROBLEM with FOR loop (my program does not run, it must start a count in 10 and end in 0)

How about friends, I have a very big question with the FOR loop, why does not this code give me results ??? That is, it does not run #include<stdio.h> int main() { int i=0; for (i=10;i<=0;i--) printf(" %d ",i); } How...
asked by 04.01.2018 / 19:53
1
answer

Problem with FOR loops

I'm trying to simplify the content of the movement function () to two loops, but doing it in loops does not do anything to me. My code is as follows: int movimimiento(){ mueve_servo(&patas[1][1], mov_home[1][1]); mueve_servo(&p...
asked by 11.11.2018 / 22:00
1
answer

Count repetitions of each letter in a string in C

I need you to guide me on how to develop a program that requests a phrase or string of text and print the times that the letters were repeated for example that the user enters the phrase Hola amigos :    H: 1       O. 2       l. 1   ...
asked by 25.08.2016 / 06:04
4
answers

C ++ | question about ranges

I hope you can help me with information to solve this type of problem. They did not give me a topic title or anything like that, only that I tried to solve it. The problem is to request x, initial number, final number x and then add from the...
asked by 15.10.2018 / 23:16
1
answer

use of malloc / free

I do not understand why this code works: #include <stdlib.h> #include <stdio.h> int main() { int i; float* a; float* b; a=(float*)malloc(sizeof(float)*10); for(i=0;i<10;i++) a[i]=i; b = a; free(a); for(...
asked by 28.05.2018 / 18:11