C.
Most of my time I use Elementary to program and Win10 to work, because of my CAD softwares.
Anonymous
You can use old (like VS2013) compilers with Qt
C.
Okay. And to make a window in a Linux system? QT works too?
Anonymous
KDE is made with Qt
C.
Oh. Nice. I'll look into that then.
Anonymous
Qt is cross-platform framework. It is kinda weird because of its legacy, but still it is powerfull
C.
Nice.
Mouhieddine
for(int i=0;i<=300;i+=20){ printf("%d\t%d\n",i, (i-32)*(5/9)); } Why this outputs "0 0" instead of "0 -17"?
Anonymous
You're incrementing i by 20 in each iteration.
First iteration doesn't increment
Mouhieddine
You're incrementing i by 20 in each iteration.
Yeah but why (i-32)*(5/9) gives me 0 insted of -17?
Anonymous
and 5./9 != 0
Vitaliy ◀️TriΔng3l▶️
maybe let's not confuse anyone with what may look like ./ :D
Anonymous
http://ideone.com/4N6vYE
Vitaliy ◀️TriΔng3l▶️
5.0 / 9 != 0 (9 becomes 9.0) 5.0 / 9.0 != 0 5 / 9.0 != 0 (5 becomes 5.0) 5.0f / 9 != 0 (9 becomes 9.0f) 5 / 9.0f != 0 5.0f / 9.0f != 0
Anonymous
Mouhieddine
because 5/9 == 0
I didn't know that. I come from Java
Vitaliy ◀️TriΔng3l▶️
I didn't know that. I come from Java
In Java, int / int == int too, as far as I know
Anonymous
I didn't know that. I come from Java
Read Prata's book — C++ Primer Plus
Vitaliy ◀️TriΔng3l▶️
and there are same float and double suffixes
Mouhieddine
C.
In Java, int / int == int too, as far as I know
It's bug prone actually. Depends on the compiler IIRC
Anonymous
Works
I know
Anonymous
Java
Don't know about Java In C++ it is standardized
C.
Java is strange.
Vitaliy ◀️TriΔng3l▶️
What compilers implicitly cast something that should obviously not be implicitly cast? O_O
Vitaliy ◀️TriΔng3l▶️
Java requires explicit casting in a lot of places BTW AFAIK
C.
What compilers implicitly cast something that should obviously not be implicitly cast? O_O
Idk. It is a language that looks like it was made for book writers
Vitaliy ◀️TriΔng3l▶️
I try to follow Java style conventions (except for starting function names from a lowercase letter) in C O_o
Vitaliy ◀️TriΔng3l▶️
to mix two of the cleanest languages
C.
I try to follow Java style conventions (except for starting function names from a lowercase letter) in C O_o
I think it's nice and clean, but to program in java, you just have to write everything too much.
Герхард
It’s hard to read your output
I said that this "traitors" are understandable because programs something that requires abstract thinking and a lot of writing... and when you finish the result is a few usable screens, but people ignore the effort and the amount of lines that were needed to get there, reducing to always say "that's easy for you, write a few commands and you're done".
Dima
this is easy
Dima
somebody is just weak
Dima
Герхард
nah.. most usefully programs need too many of our life time.. if you does not document and does not poin good notes.. you are a bad programmer and those thing need LOT OF time
Dima
You get used to it, this is it
Anonymous
i like this group very much
I_Interface
Герхард
You get used to it, this is it
i dont like to spend my time in only job sorry!
Герхард
i have more to do thant just only work work
Dima
Dima
do what you want
Anonymous
int* fun(int *arr, int len){ int *b = new int[5]; //inserting values into array b return b; } int main(){ //made an array arr and the int *b = fun(arr,len); //How to iterate through array b } If I want to iterate through array b, then how do i know the length of b in main?
Герхард
do what you want
well.. in ohters words> anybody want spend time in only coding.. that-s why you call it "traitors" due we also wants more to do..
Dima
Shut up man
Dima
you are very annoying with such words
Dima
just do what you want, as I have said, ot
Anonymous
you don't. But have len passed to the function. Otherwise you would need to pass it along.
ok. had this been the char* then, wouldn't it be easy to know that. loop till you find '\0'
olli
ok. had this been the char* then, wouldn't it be easy to know that. loop till you find '\0'
Yes and no. This works for "C-strings" but not for binary strings (e.g. files)
Герхард
Shut up man
and you cannot change that! of course... i like coding but i also like more eat delicios food as example..
Anonymous
you don't. But have len passed to the function. Otherwise you would need to pass it along.
I hope that you are saying to pass len as a reference to the function. Although didn't get your 3rd line.
Anonymous
didn't you want to say return it along than pass it along?
olli
didn't you want to say return it along than pass it along?
yes, return it along. Or in general pass it along with the pointer by e.g. creating a structure containing the size and the pointer (kinda similar to std::array)
Anonymous
So, I was reading the difference between arr and &arr. And it showed that arr mean the address of the first element and &arr mean the address of the entire array.
Anonymous
No😂😂😂
Anonymous
I mean then if you do &arr + 1 would increament by the size of the array and not 4
olli
So, I was reading the difference between arr and &arr. And it showed that arr mean the address of the first element and &arr mean the address of the entire array.
arr is the pointer to the first element and where the array starts. &arr is the address of the pointer to the array / memory region
Anonymous
T arr[n] is array arr is array that decays to a pointer
Anonymous
sizeof(arr)/sizeof(arr[0])
I was going to say if this is correct of not.
olli
I was going to say if this is correct of not.
it's not. since arr is a pointer (hence size 8 or 4...)
Anonymous
No
I think he is writing it in context of the code. Ain't he then be correct?