klimi
C LANGUAGE
Like... have you read the rules? just put it in chatgpt...
Subhajit
How do i convert .cpp file to an dot exe file in vscode?
100$ website
How do i convert .cpp file to an dot exe file in vscode?
there are two three videos on Yt one by bogdan C
Subhajit
Okay let me check it
Subhajit
I need for vscode
Subhajit
In vscode?
DaviChan
Actually you also need to link it to a PE file also, but i don't want to be a nerd here. Just ask GPT on how to compile on your system and it will tell you
DaviChan
can suggests clang as a compiler. It's one one the better ones to work with. I dont like MSVC sometimes
Elil 50
Did anyone created a Ran2 pseudorandom generator library compatible with C++11 <random> standards?
Amrith
In vscode?
you need to setup vs code first with compiler paths and commands. it's better go with an ide like code blocks or Clion that has preconfigured cpp
Subhajit
you need to setup vs code first with compiler paths and commands. it's better go with an ide like code blocks or Clion that has preconfigured cpp
All set up vscode path and mysys2 all finished. I built a simple calculator and i want to send it to my friend. Can i get the exe file in msys2/bin?
Amrith
Can you specify how to do it in vscode?
there should be YouTube videos on how to setup vs code for c++ , you will write a json file that will be used by vscode as profile
Chat Boss
𝓢𝓻𝓾𝓵𝓲 sent a code, it has been re-uploaded as a file
𝕾𝖗𝖚𝖑𝖎
𝓢𝓻𝓾𝓵𝓲 sent a code, it has been re-uploaded as a file
Can someone plz explain why its outputting a 0?
Amrith
I couldn't find any please give link of a video
https://youtu.be/77v-Poud_io basic setup. there are tons of videos!!!
Dima
don’t use vscode for c/c++ lol
alessandro
visual studio community
alessandro
it's good
mrab
yes, i use vs2019
alessandro
Nvim Bruh
what is nvim?
а
Vim's fork But better
alessandro
vim is userful if you are able to use it
alessandro
if not, it's really hard
а
Insert to write code Esc to write commands :wq - save and exit :q - exit :qa! - discard changes and exit
а
Nothing hard
Subhajit
https://youtu.be/77v-Poud_io basic setup. there are tons of videos!!!
But i have already done set up. I need to convert the cpp into exe file
Anonymous
not on windows :)
а
not on windows :)
It's not hard to install g++ on windows
а
I have g++ gcc
So just use command
Anonymous
more like c:\windows\path-from-hell...exe -lotsofflags main.cpp
Anonymous
With g++ life is better
Anonymous
I would use visual studio community edition under windows.
Subhajit
Yep
If my file name is task1.cpp Then give the command
Subhajit
I would use visual studio community edition under windows.
Is this different from official vscode?
Anonymous
The latest msvc is not bad, and the ide is quite good.
Anonymous
vscode is crap. made for javascript devs, who love crap.
Anonymous
The only thing vscode does well is remote code execution exploits :)
Subhajit
g++ task1.cpp -o task1.exe
Oh got it .\task1 The above command worked
mrab
emmm i thought g++ is only use in linux,which don't need .exe😂
Amrith
But i have already done set up. I need to convert the cpp into exe file
Dude do you even know what a compiler is? the setup explans everything. after successful compilation and linking you get ".exe" file
Subhajit
Dorith
Is there anybody who uses a macos to c++ development
Anonymous
no, no one uses that
Sure people juse it. But mostly for non-gui apps I guess. I wrote a crypto wallet library for IOS and Android a few years ago in C++. Lots of time wasted with objective C to make it available to the IOS app written in Swift.
Anonymous
With QT its simpler, but you lose the "native" GUI experience.
the best for everyone
https://onecompiler.com/c/3yraaf6kq
the best for everyone
what is the problem in this code ?
Anonymous
that was a sarcasm to show that the question is stupid... ._.
I dont know a single C++ developer that use macos as their primary platform.
Dima
there are a lot
Dima
Is there anybody who uses a macos to c++ development
use xcode or clion, xcode is very c++ friendly and uses clang but xcode gets really slow on large projects, talking about static analysis also one good approach is Appcode, it is like xcode and it fully supports c++ to with fancier ui you don’t need to use objective-c anywhere, unless you’ll want to use system ui menus
Dima
simply use makefile generators (there are tons, like genie utility) which can recreate a project file for almost every ide, crossplatform-ish
Faramarz
Why line s1->x = 4 causes segmentation fault? #include <stdio.h> struct student{ char name[51]; int x; float g[5]; }; int main() { struct student *s1; s1->x = 4; return 0; }
alessandro
It might be better if you use calloc
Velorek
Why line s1->x = 4 causes segmentation fault? #include <stdio.h> struct student{ char name[51]; int x; float g[5]; }; int main() { struct student *s1; s1->x = 4; return 0; }
Does it have to be a pointer though? Are you building a linked list? If not simply use an array with a fixed number of students as in: int main(){ struct student sID[10]; sID[0].x = 4; return 0; }
the best for everyone
Velorek
anyone help ?
You have to remove deref symbol & from counter variable -> printf(" << %d",counter);
Velorek
Otherwise you're getting a big number that stands for the pointer's address in memory instead of its content
the best for everyone
I got zero for the answer
Velorek
I deleted that but it still didnt count anything
Yes, because the logic is faulty. Note that you are only incrementing counter value at the end because of the final condition