Jump to content

Basic questions about c++. Anyone can prob answer (I'm a Noob)

jewishdolphins

DISCLAIMER: I'm new to programming. I keep posting stuff on here but people are being either very vague with their answers or they just give me the "techy-talk". Nearly every response I get is too complicated for me to understand. So if you want to reply to this, please at least try to put it in stupid terms for me since I'm very new to programming. If it takes a lot of text to describe, that's fine too.

 

I am new to C++ and have no clue how to run my code or where to write my code. What's the standard? I was just thinking of using NotePad++ to type my code and then just run the code in some kind of compiler. Which compiler should I use for C++? Most people I know were talking to me about something called "IDE's" which apparently consist of things like Visual Studios. I don't know the difference at all between compilers and IDEs or which one I should use.

 

Basically, I want to start coding. But have no idea where to write code for c++ or what things I should have downloaded for it. I just want a fast solution. And no I don't want to use those online c++ compiler things. I want something to download and use permanently. So please, be as descriptive as possible and inform me about how this all works (in stupid terms)

Link to comment
Share on other sites

Link to post
Share on other sites

If we're too vague or too "techy-talk", please tell us, and we'll clarify. In addition, please don't create new posts consisting of very similar questions, just stay on this one: 

 

˙ǝɯᴉʇ ɹnoʎ ƃuᴉʇsɐʍ ǝɹɐ noʎ 'sᴉɥʇ pɐǝɹ oʇ ƃuᴉʎɹʇ ǝɹɐ noʎ ɟI

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, dannytech357 said:

If we're too vague or too "techy-talk", please tell us, and we'll clarify. In addition, please don't create new posts consisting of very similar questions, just stay on this one: 

 

No one ever really clarifies. Your most recent reply on the other post just clarified something

Link to comment
Share on other sites

Link to post
Share on other sites

IDEs are integrated development environments, they highlight the syntax and make it easier to code

Compilers are what executes the code.

I recommend using visual studio or eclipse.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, NoGravityPanda said:

IDEs are integrated development environments, they highlight the syntax and make it easier to code

Compilers are what executes the code.

I recommend using visual studio or eclipse.

Compilers convert your code to machine instructions, it does not execute code (thats what interpreters do).

Desktop: Intel i9-10850K (R9 3900X died 😢 )| MSI Z490 Tomahawk | RTX 2080 (borrowed from work) - MSI GTX 1080 | 64GB 3600MHz CL16 memory | Corsair H100i (NF-F12 fans) | Samsung 970 EVO 512GB | Intel 665p 2TB | Samsung 830 256GB| 3TB HDD | Corsair 450D | Corsair RM550x | MG279Q

Laptop: Surface Pro 7 (i5, 16GB RAM, 256GB SSD)

Console: PlayStation 4 Pro

Link to comment
Share on other sites

Link to post
Share on other sites

The compiler converts your code to machine code in the form of a object file.

Each source file (larger projects are spread into multiple source code files) is converted to a object file, for example if your project contains:

 

MainProject.cpp

SomeLibrary.cpp

AnotherLibrary.cpp

 

Then after compilation you will end up with:

 

MainProject.o

SomeLibrary.o

AnotherLibrary.o

 

Combining all those object files into a single executable is done by the linker.

 

It's important to understand this to be able to distinguish compilation errors from linker errors.

 

A Debugger allows you to step trough your code line by line, keeping a watch on variables so you can see what happens and try to catch bugs. A compiler will have the option to compile code eigter for release or debug. Debug code contains all kinds of checks and hooks to ease the debugging process, but because of this runs much slower. Release code is used when the program is done and debugged, and is ready to be released. Release code is much faster then debug code.

 

A IDE or integrated development environment combines a editor, compiler, linker, debugger and possible other tools into one package. It allows to easily overview, search and edit your program and compile and run/debug with a single click.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, mathijs727 said:

Compilers convert your code to machine instructions, it does not execute code (thats what interpreters do).

Yeah, just didnt want to confuse him more

Link to comment
Share on other sites

Link to post
Share on other sites

19 hours ago, jewishdolphins said:

Basically, I want to start coding. But have no idea where to write code for c++ or what things I should have downloaded for it. I just want a fast solution. And no I don't want to use those online c++ compiler things. I want something to download and use permanently. So please, be as descriptive as possible and inform me about how this all works (in stupid terms)

I know the feels. What my go to solution to this problem is is to make the person install the appropriate compiler and linker. Then, I would make them write the program in a .<insert type here>file (in something like notepad, or notepad++) and then use the command line to run it through the compiler, and then the linker if necessary.

Then I would tell them about this awesome thing called an IDE, or Integrated Development Environment, that does all of that stuff for you and more, so that you can focus on writing code. If you want to learn the C family of languages (C, C++, C#), I would do so with Visual Studio Community, which can be found here: Visual Studio Downloads. Then, I would have them follow this guide: Getting Started with C++ in Visual Studio.

After that, you can go to http://www.learncpp.com/ to follow a good guide to learn the language and programming.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

On ‎10‎/‎30‎/‎2016 at 7:09 AM, jewishdolphins said:

DISCLAIMER: I'm new to programming. I keep posting stuff on here but people are being either very vague with their answers or they just give me the "techy-talk". Nearly every response I get is too complicated for me to understand. So if you want to reply to this, please at least try to put it in stupid terms for me since I'm very new to programming. If it takes a lot of text to describe, that's fine too.

 

I am new to C++ and have no clue how to run my code or where to write my code.

Usually, you use an IDE........

On ‎10‎/‎30‎/‎2016 at 7:09 AM, jewishdolphins said:

What's the standard? I was just thinking of using NotePad++

NotePad++ is the most overrated program ever made.

On ‎10‎/‎30‎/‎2016 at 7:09 AM, jewishdolphins said:

to type my code and then just run the code in some kind of compiler. Which compiler should I use for C++?

If you use an IDE, it will use a good compiler and have loads of amazing features.

On ‎10‎/‎30‎/‎2016 at 7:09 AM, jewishdolphins said:

Most people I know were talking to me about something called "IDE's" which apparently consist of things like Visual Studios. I don't know the difference at all between compilers and IDEs or which one I should use.

Yes, you should use them. Anybody who is serious about programming uses one with the exception of Web Developers.

On ‎10‎/‎30‎/‎2016 at 7:09 AM, jewishdolphins said:

Basically, I want to start coding. But have no idea where to write code for c++ or what things I should have downloaded for it. I

Download Visual studio 2015 Community. Visual Studio is the gold standard for making Windows based applications whether it's C++ based, C# based or otherwise. The community edition is free for hobbyist programmers, open source developers and small development teams.

On ‎10‎/‎30‎/‎2016 at 7:09 AM, jewishdolphins said:

just want a fast solution. And no I don't want to use those online c++ compiler things. I want something to download and use permanently. So please, be as descriptive as possible and inform me about how this all works (in stupid terms)

Download Visual Studio 2015 Community (fair warning though: You'll need 8+GB storage space!)

 

Make sure to enable the "Common C++ Tools" checkbox.

 

If you're using Windows 10, check the option to download the Windows 10 SDKs (10240, 10586 and 14393).

 

If you're using Windows 8.1 then it will give you the option to download the Windows 8.1 SDK.

 

If you need any more help then give me a shout by typing @AluminiumTech.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

I used to learn a little bit of C++

The IDE I used to use is called: code_block. It is a open-sourced program. 

It is completely free. And it has OS X as well as windows version.

Here's their website. 

http://www.codeblocks.org/

 

You type in the code, compile, check is there any error or not. If not then run.

It is just that easy. 

 

Happy Coding!

I am currently learning HTML5 CSS3.

If you want, you can add a lot of people on gitter. I am using it. 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

If you want to learn the basics start simple. No need for a big IDE with lots of features you wont use. Get any text editor with syntax highlighting (Notepad++ e.g. if you are on windows) and install the gnu compiler collection (gcc). Write your code, save it as .cpp and use the compiler via command line (g++) to compile the code. Thats it.

Link to comment
Share on other sites

Link to post
Share on other sites

Visual Studio is really easy to use and there is a free version that's fine for using while learning. I would strongly advise against trying to learn to program by starting with C++. C++ is way too complicated and low level a language for a novice to learn to program with effectively. Scheme and Python are much better choices. Even Java is better, though it's not a great first language either. C++ is a great language to pick up once you're already a decent programmer. You gotta learn to walk before running.

 

Now this is a great starting point for learning how to program (the course uses Python and assumes you know nothing whatsoever about programming):

https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-8

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I am still a student that is related to computer sciences, but I mix my C++ learning with school and a bit of learning from other sources.

 

SoloLearn's courses is usually entry level, but does teach C++ at no cost, just requires signing in to verify the tutorial certification.

 

Any case, as what others have said, it is best to start out in an IDE, which is where Visual Studio Community comes in. Requires an account to sign in and register for the free license after a set period of time. Usually, Microsoft's Visual C++ is used along with the C++ standard library. Has a system that prepares the typical setup for use, but new programmers are directed to Console that uses the command line or terminal.

 

But yes, jumping straight into C++ without some knowledge of languages would hurt. I was introduced through C# and Python.

Spoiler

Primary PC - Lenovo ThinkPad Edge E531 w/ 8GB RAM and HDD to SSD upgrades - Multi-Purpose / Light Gaming Laptop

Aurelia Null Box - Custom Gamer-Developer Hybrid Desktop PC: Link Below (Intel Core i7 6700, RX 480)

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

In the end, a language like c++ requires simply a text editor and a compiler.  Visual Studio is a fully-fledged IDE and uses a Microsoft c++ compiler, and has a bunch of features to make writing c++ code easier. 

 

Just remember that at this point it doesn't really matter what language you use but how you use it. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×