Questions tagged as 'c'

1
answer

How to pass a function as parameter in C?

I wanted to know how the function passed by parameter works just like in pthread_create (thread,atributo,rotina,argumento); . In the rotina field a function is placed in void* .     
asked by 30.01.2014 / 02:01
3
answers

What happens in a conversion from a char to an int?

How does it work when you get a variable and make char-48 to transform into an integer, for example in this code I made, I used a date for example "22/05/1994" stored in a char vector and turned it into day, month and year all in integer...
asked by 01.02.2014 / 22:03
4
answers

What is buffer overflow?

Whenever I use the gets() function the compiler returns me the following warning:    function is dangerous and should not be used Translation:    This function is dangerous and should not be used I hear a lot about the fact...
asked by 27.02.2016 / 23:49
3
answers

What is the purpose of while (0) and while (1) in C?

What is the purpose of this? While(0) or While(1). The 1 verifies that it is correct and the 0 that is wrong? Why?     
asked by 17.12.2015 / 03:40
2
answers

How does bit shift work in C / C ++?

I'd like to understand how bit shifting works in C / C ++ . I would also like to understand how the processor performs the calculations and how it handles all of this. I have some examples in C / C ++ : void USART_Init(unsigned int ubrr0)...
asked by 22.03.2014 / 15:08
4
answers

How to deal with a kite process?

Analyzing the linux API I noticed that an interesting structure is possible: #include <unistd.h> #include <stdlib.h> int main() { while (1) { if (fork()) exit(0); // Altera meu pid setpgid(0, 0); // Cria um...
asked by 31.01.2014 / 15:54
1
answer

C programming using GTK

I have to make a game like work in college (Scrabble). The problem is as follows. When the event_box of the player's lectern is pressed I call a callback function, so that the image that is in the% pressed% is removed and then adds ano...
asked by 20.11.2015 / 02:30
1
answer

How does the static life time work?

I just saw a question about C. In it the following code was shown: #include <stdio.h> int main() { static int a = 5; printf("%d", a--); if(a) main(); return 0; } Example running on repl.it. And the ch...
asked by 31.08.2017 / 17:42
4
answers

How do graphic libraries work?

How do graphic libraries work? For example, the default mode of execution of C is the console application, since from this text-only, can it create the graphic libraries where it understands pixel instead of letters and characters? how do the...
asked by 07.08.2015 / 15:04
1
answer

Is it possible to interact with C # code outside of .NET?

How do I call code written in another language that is not part of .NET, for example the C language? How does this interaction work? How do I call native Windows functions?     
asked by 09.08.2017 / 14:02