olli
I like vs Code
Why don't you use it then?
Anonymous
does not have a compiler
Anonymous
Pretty sure it does
Anonymous
Why not just use a seperate compiler anyway?
olli
does not have a compiler
neither does eclipse, geany, kdevelop, clion or anjuta.. (and most other)
Anonymous
sometimes I get errors when the code is ok
Anonymous
In vs code for MinGW
olli
did you use and configure the C++ Extension?
Anonymous
Going offtopic here but I have no idea how people use Windows for serious development
Anonymous
I use two extension
Anonymous
I can't imagine not using Vim + GCC/G++ on a Linux system as a dev workflow
Anonymous
I can't imagine not using Vim + GCC/G++ on a Linux system as a dev workflow
I have a question On C++ and linux Should I ask in OT?
Anonymous
how is using gcc/g++ on Windows any different?
I haven't tried to do it but I presume it's difficult to setup
Anonymous
I keep seeing people in programming groups having loads of problems because they're trying to do stuff on Windows
Anonymous
I'll head over to offtopic
Anonymous
Windows for design
Ludovic 'Archivist'
its passage is here
Take a sheet of paper and run the function with pen and paper
🐰🐾 سمیه
Take a sheet of paper and run the function with pen and paper
I did that, if you know how it works, I ask a question.
olli
I haven't tried to do it but I presume it's difficult to setup
On Windows I would recommend to use msys2, which comes with pacman as package manager. So it's nearly the same
Anonymous
Pacman on windows? Wack.
Naman
I did that, if you know how it works, I ask a question.
One thing that you probably haven't realized that the remainders (n%10) need to be printed in the opposite order for the number to be printed correctly. So, in the function printd: 1. Print a minus sign if the number is negative and then, having done that, turn the number positive (since negative of negative is positive). 2. If the number if greater than 10 (if (n/10)), call printd again with n/10 so that the remainder that gets printed (in the next step) gets printed in reverse order. 3. Find the last digit of n by doing n%10, find its ASCII representation by adding it to '0' (the character '0', not the number 0) and then printing it. Take an example number and try to work with it.
Anonymous
Because --1 == +1
--1, wont it work as pre decrement, and probably give error because 1 is literal?
Daniele°
non recursive version of printd void printd(int n){ char str[24]={0}; size_t i = 22; if( n < 0 ){ putchar('-'); n = -n; } do{ str[i--]=(n%10)+'0'; n/=10; }while(n); puts(&str[i+1]); }
Mal
How many header files in c++???
Mal
Can someone answer my question?
S.
Everyone can create as many header files as they want …
olli
How many header files in c++???
http://eel.is/c++draft/headerindex
🐰🐾 سمیه
http://eel.is/c++draft/headerindex
Hi. Recursion is really hard in C, one should be a genius to use it. Have you ever written one by yourself in real program?
Mal
http://eel.is/c++draft/headerindex
Which One i should leaen after <iostream>???
olli
Hi. Recursion is really hard in C, one should be a genius to use it. Have you ever written one by yourself in real program?
Sure I have, depending on the context I prefer iterative implementations though (can be hard to prevent stack overflows in recursion)
olli
Which One i should leaen after <iostream>???
You shouldn't "learn" header files, you should learn the language. Use the header that solves your problem
🐰🐾 سمیه
Ok thanks👌🌷
🐰🐾 سمیه
In recursion, if we call a function for two or three consecutive times, are they all called at the same time, or one at a time?( like the ones for qsort in the picture below).
🐰🐾 سمیه
olli
In recursion, if we call a function for two or three consecutive times, are they all called at the same time, or one at a time?( like the ones for qsort in the picture below).
"recursion" has no effect on a function invocation. You might want to read this article https://en.wikipedia.org/wiki/Recursion_(computer_science)
MᏫᎻᎯᎷᎷᎬᎠ
.
🐰🐾 سمیه
yes
We have two parts, left of pivot and right of it.) the first qsort (v, left, last) deals with the left part. And the second one qsort(v, left, last - 1) deals with the right part. My question is, if second qsort is called after first one is done, then the first one changes parameter for the second one ( it changes left and last). So how it really works?
🐰🐾 سمیه
God how you knew that😥
🐰🐾 سمیه
where would you expect to see them?
I expect to see the processes in code, but it's like if an internal function calls itself more than twice, the rest will be done behind doors that I can't see them.
olli
I expect to see the processes in code, but it's like if an internal function calls itself more than twice, the rest will be done behind doors that I can't see them.
But isn't that the case for all function invocations? x is also "created" twice although the code contains it once. void bar(int x) { (void)x; } void foo() { bar(3); bar(2); }
🐰🐾 سمیه
But isn't that the case for all function invocations? x is also "created" twice although the code contains it once. void bar(int x) { (void)x; } void foo() { bar(3); bar(2); }
You're right, it's the case for all of them. By twice you mean first in actual argument, and second in the called function itself (in the braces) ?
🐰🐾 سمیه
🐰🐾 سمیه
In this example, aren't copy's argument passed by value? So why are their state changed in main? Is it because its arguments are arrays?
Sanjay Tharagesh
In this example, aren't copy's argument passed by value? So why are their state changed in main? Is it because its arguments are arrays?
Yup. When you pass array name as a argument. The name denotes the starting address of array. So basically you are passing it by reference. So the array contents will be changed.
🐰🐾 سمیه
👌 Thanks
🐰🐾 سمیه
Anonymous
nice rules..😁😁😁
Anonymous
install visual Studio there is a moment someone can tell me how to create a project in C?
Faab
Thanks
klimi
#ot
Dima
Lol.
klimi
Lol
Elnee
Why not
Elnee
¯\_(ツ)_/¯
Mihail
But otherwise it is true
Anonymous
Yeah not in C/C++ itself
Oh, i am sorry i missed the point. You guys were following that recursive function i guess
klimi
Welcome Ehtesham
klimi
Welcome
Shaji
Hi
miko
hello
Anonymous
Hey
klimi
@roxifas that bot should forward it somewhere too
Dima
Stop