Anonymous
Usually, you should pass a parameter that would tell the type
when i use qsort for example int sort_numbers(const void *a, const void *b){ int first = *(int *)a; int Second = *(int *)b; return first - Second; i use this as the comparator function
Anonymous
using a void pointer and casting it within the function
Javi
It's dangerous, because if the pointers aren't int, you will have a crash or undefined behaviour
Javi
Since both first and second are int, why don't you pass int's?
Anonymous
i have no clue what it is , i just seen it mentioned a few times
Javi
That's c++, not c
Javi
You would be getting into c++ and templates
Anonymous
That's c++, not c
o i see , i got alot to learn lol
Anonymous
You would be getting into c++ and templates
well i have work now , i will be back on in a few hours if you are still around . thanks alot for the help .
Anonymous
Is there some types except of char, int and double?
its either a character array or int array
András
its either a character array or int array
I mean Can you say, that all element of array is one of those?
András
Or there are some more?
gallo
Hi
Anonymous
I mean Can you say, that all element of array is one of those?
The array is either gonna be an array of ints or an array of strings
gallo
I was thinking passing a union
Do you have a graduation?
gallo
Huh
Yes?
Anonymous
Do you have a graduation?
I don’t understand the context of the question
Anonymous
Curiosity
I am self taught
gallo
I'm studying computer science in Catania(Italy), I wanted to find an other person that study computer science
gallo
Studies* sorry for my english
Anonymous
I'm studying computer science in Catania(Italy), I wanted to find an other person that study computer science
I am studying , it’s ok, I understand you , if you want a study buddy I am open
Anonymous
Okay
How far you in your degree? What languages have you worked with so far ?
gallo
How far you in your degree? What languages have you worked with so far ?
I started in september😂 I graduated at school this year... We took C and C++ in these 2 month of course
gallo
Where are you from?
gallo
NY
Nice
gallo
There are some Italians?
Anonymous
gallo
There are many
Daniel, are you american...? STOP TO EAT ALFREDO
Anonymous
There is a pizza shop on every other block
gallo
I have eaten Alfredo lol
Alfredo doesn't exist in Italy lol
Anonymous
It’s not Italian ?
gallo
I discovered alfredo in a video called "cosa trovi in un supermercato americano" (what do you find in an american supermarket)
gallo
It’s not Italian ?
Yes, but in Italy it is not sold
gallo
Because we in italy don't like it
Anonymous
Yes, but in Italy it is not sold
What is popular in Italy ?
Nomid Íkorni-Sciurus
It’s not Italian ?
Not technically it was invented by italoamerican people starting to mix the traditions and it happened that a man called Alfredo (which had a restaurant in Italy) used that sauce because american tourists requested it.
Nomid Íkorni-Sciurus
Also the story about our pasta being chinese is totally a lie coming from american advertising in the 30s (and before) to make it appear more exotic and "cool".
Nomid Íkorni-Sciurus
Our "pasta" is actually thousands of years old, dating back to the early Etruscans (and even older italic poeple). During the time, we never shared anything with chinese cousine. (because they're too different, mainly)
Foxner
Are Italians also to blame for spaghetti code?
Nomid Íkorni-Sciurus
Anonymous
Chinese food in America is also only in America lol
Anonymous
I went to China and their food is different
TopG
guys any c++ course (video) recommendation ?
ʜɪɢʜΐąɴɗɛ҉⃤Ř
Hello guys i'm beginner. what's mean the code inside of the while block ? #include <linux/input.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> int main(int argc, char **argv) { int fd; argc = 3; if(argc < 2) { printf("usage: %s <device>\n", argv[0]); return 1; } fd = open(argv[1], O_RDONLY); struct input_event ev; while (1) { read(fd, &ev, sizeof(struct input_event)); if(ev.type == 1) printf("key %i state %i\n", ev.code, ev.value); } }
H̲i̲L̲e̲v̲e̲l̲
ok thank you, I will try right now
I can help you more in PM
H̲i̲L̲e̲v̲e̲l̲
If you want
Anonymous
welcome
MengShu
It is a loop
It is a loop, continuously read data from the file (fd) you opened. Is it right?
Anonymous
this
MengShu
BTW, the handle leak problem I ran into yesterday was not caused by service... It is OS related issue. The issue cannot be reproduced on Win 10 1903 but can be reproduced on Win 10 IoT 2016.
MengShu
Ilya
It is a loop, continuously read data from the file (fd) you opened. Is it right?
Most probably, this is NOT a (usual) file but a device file.
MengShu
I doubt
I have tried devcon and my application on both IoT 2016 and 1903 so I think it might relate to OS version. Anyway, I post an issue to MSDN forum and hope that I can get some comments from MS.
Ander
I can help you more in PM
Yes please😃😃
MengShu
Most probably, this is the problem of your service which can be traced and diagnosed on one OS, and cannot on another one.
To clarify if the issue was caused by my service, I create a console application an use the same methods to control the device. I also use devcon.exe from Windows SDK to test it and got the same result.
MengShu
Simple C app and services have different lifetime circles so this is not an indicator.
You mean that I need to check if my service will not cause the same issue on Win 10 1903 and then it can be an indicator. Is it right?
Abcd
Careers in c++
Abcd
? Anyone