Questions tagged as 'c'

2
answers

What is the use of the operator% in printf of variables in C language?

I am starting a course on YouTube from C. And they show that to print the values of the variables it is necessary to use this operator % . example: int suma, a, b; a=2; b=3; suma=a+b; printf("El valor de la suma es %i", suma); I...
asked by 31.03.2017 / 21:03
4
answers

C ++ Questions about the Goto instruction

Studying programming I come across this strange instruction, in a certain way I understand that it jumps to the instruction it points to but why it is not used? The truth is a curious alternative to loops and conditional but I read that it is no...
asked by 28.02.2017 / 16:09
2
answers

Delete an element in a vector in C

I have developed this algorithm that loads, displays and removes elements in a vector. But when I give it to delete an element, it only eliminates the last one and not the one that I choose. For example, I input the elements: 4, 5, 6; and then I...
asked by 22.01.2016 / 18:42
3
answers

Smoothing of fonts with 8-bit color per point

I am using uGui to display fonts on the screen. But the final result is not as satisfactory as it should be. The hardware is quite limited: color of 8 bpp (256 colors in total), with 3 bits for red, 3 bits for green, and 2 bits for blue (3: 3:...
asked by 10.05.2018 / 12:09
2
answers

Difference between undefined behavior, not specified and defined by the implementation

Many times we talk about undefined behavior, not specified and defined by the implementation in c . However, what is the difference between these concepts?     
asked by 14.05.2018 / 11:52
3
answers

Assign a floating point literal without a suffix to a float

Taking into account that in C / C ++ the floating point literals without a suffix are by default of type double , then when assigning a literal of this type to a float an implicit conversion is made from double to float . float n = 3.14;...
asked by 25.10.2016 / 04:59
1
answer

What is the point of using setvbuf or setbuf in ansiC?

What is the advantage or in which situation would it be useful to use the functions setvbuf() or setbuf() in the ANSI C language? It happens that I have read the theory and I have experimented with the functions, but I do not no...
asked by 17.08.2018 / 02:17
2
answers

Libraries of c ++ and c

Good morning. I would like to know some concepts about the c ++ and c libraries. My first question would be why you can use stdio.h in c ++ in addition to iostream, and which is better to use in the end, besides another question would be the dif...
asked by 08.02.2017 / 01:29
3
answers

Is it safe to return?

Why is it safe to return string2? at the end of the function the stack frame would not be overwritten? I have seen that many compilers save the literal "hello" in a memory-only zone, which is why it is safe to return string2 without the stack fr...
asked by 08.05.2018 / 21:56
1
answer

Read directory from console in C

Hello, I have the following code: #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <dirent.h> // Libreria encargada del tema de los directorios #include <string.h> void load(){ char dir[250]...
asked by 08.05.2017 / 17:37