> means greater than
>= means greater than or equal to
< means less than
<= means less than or equal to
== means equal to
!= means not equal to
These are basically the operators that you need. You will need &&, ||, and ! in the future but not now.
Arrays!
Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
To declare an array, define the variable type, specify the name of the array followed by square brackets and specify the number of elements it should store:
string trucks[4]; (delete this before you run the next line)
// this is a comment
// 4 states how many objects will be in the array.
// to store arrays, just add these brackets{} afterward.
string trucks[4] = {"Cybertruck", "Ford F-150", "Chevrolet", "GMC"}; (Truck companies don't sue me)
And of course, you can use int, char, double, float to subsitute for "string". so you can do stuff like this...
int numbers[4] = {1, 2, 3, 4};
And to "print" (cout) these things, just do,
#include <bits/stdc++.h>
using namespace std;
int main()
{
string trucks[4] = {"Cybertruck", "Ford F-150", "Chevrolet", "GMC"}; (Truck companies don't sue me)
cout << trucks[0]; // this will print out Cybertruck.
/* Note: trucks[4] states how many objects is in the brackets,
but [0] will always be the first element. [1] will be the second, etc.
*/
return 0;
}
Sorry for the delay guys!
If there are any bugs/typos, please let me know in the comments below.
Shoutout..... @DynamicSquid "rebellious people are losers."
@HahaYes yeah. It has its uses. On this site you will usually see low quality posts made in python. In Cpp or any other Language of its complexity you will see only the highest of content.
High level - easiest/ closer to English Assembly language - I’d consider Cpp here when comparing to python although I think it’s More of a high level language
Sorry for asking, but what does garbage collector, pointers, and obscure opciones mean? I’m in my first year of computer science, so idk, grade [email protected]
@dillonjoshua68 oh ummmmm basically garbage collecter makes a programming language safer. (of course Cpp doesn't that is why it is fast) pointers, look it up, and I have no clue obscure opciones mean
C++ Tutorial: Day 4!
Day 4 of C++ Tutorials!
EDIT: Willing to hire people for this for 7 cycles per post. "A cycle a day keeps unemployment away!" - @CodingCactus
Devoted Follower
@SpaceFire !
Very devoted follower is him!
Day 4 is about........ ummmm......
Operators!
Every Single Operator(for beginners)
These are basically the operators that you need. You will need &&, ||, and ! in the future but not now.
Arrays!
Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
To declare an array, define the variable type, specify the name of the array followed by square brackets and specify the number of elements it should store:
And of course, you can use int, char, double, float to subsitute for "string".
so you can do stuff like this...
And to "print" (cout) these things, just do,
Sorry for the delay guys!
If there are any bugs/typos, please let me know in the comments below.
Shoutout..... @DynamicSquid "rebellious people are losers."
Ummmmm Day 5 is probably about arrays and loops.
Hey man. Dont you hate it when people say C and Cpp are low level languages. They are very high level.
@Jakman Yeah, assembly is low language. I consider Cpp and C somewhere between like low and high
@HahaYes true. C is high level so is Cpp. Python is straight english.
@Jakman Python is english. That's why it is basically useless
@HahaYes yeah. It has its uses. On this site you will usually see low quality posts made in python. In Cpp or any other Language of its complexity you will see only the highest of content.
@Jakman yes...
@HahaYes people will get real quiet if a post about pythons easiness is made
@Jakman yeah... I have a question... in Competitive programming, should I use python? (I use C++)
@HahaYes That would work nicely compared to python.
@Jakman yeah that would suck
@HahaYes nah that would not suck. Cpp gives you lots of control as compared to python. Just dont try to make any GUI's in it.
@Jakman yeah, competitive programming is insane
@Jakman Then what is low level?
@CodeLongAndPros hex,binary,turing machines, the metal.
@CodeLongAndPros and dont forget the periodic table.
@CodeLongAndPros there are 3 different types
High level - easiest/ closer to English
Assembly language - I’d consider Cpp here when comparing to python although I think it’s More of a high level language
Low level
@Jakman So is BF high level?
@dillonjoshua68 How it’s arranged:
High:
Anything with
import
, garbage collector, can be OOP.Middle:
No garbage collector, pointers.
Low:
Uses CPU registers, obscure opcodes.
Sorry for asking, but what does garbage collector, pointers, and obscure opciones mean? I’m in my first year of computer science, so idk, grade [email protected]
@dillonjoshua68 oh ummmmm basically garbage collecter makes a programming language safer. (of course Cpp doesn't that is why it is fast) pointers, look it up, and I have no clue obscure opciones mean
@CodeLongAndPros BF is low-level. Gifted minds are needed for such a language
@Jakman yesssss
@Jakman But there's automatic memory management!
@CodeLongAndPros hmm this is better than automatic memory managment
https://www.youtube.com/watch?v=OWWu05YYbNI
@HahaYes

@CodeLongAndPros Hmmm @HahaNo exists
@CodeLongAndPros Don't