> 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."
Pretty much cuz they are people who started programming recently, I’m nearly done with my first year of Computer science, and it’s in grade 10, the school wanted us to use python, since it’s a quick, ez, object-oriented programming language @HahaYes
I sure will be ready... I mean u can understand how newbies struggle a lot in the beginning at python [email protected] I’ll do a comparison between them and choose one
@dillonjoshua68 Be sure to know the concepts of Python well. Not everything is done for you. Python is going to hold your hand in ways you will regret.
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.
We want pointers we want pointers. Screw the pykids. We want pointers.
@Jakman ummm ok pointers
@HahaYes that's illegal
@Jakman lol all these python kids are kinda bad
@HahaYes yeah we need a content cop on this site.
Pretty much cuz they are people who started programming recently, I’m nearly done with my first year of Computer science, and it’s in grade 10, the school wanted us to use python, since it’s a quick, ez, object-oriented programming language @HahaYes
@dillonjoshua68 on this site it is easy to exploit its easyness to make a low quality proj look good to retards.
Oh ok 😅, but again, it only looks hard for some people becuz their doing GCSE level computer science @Jakman
@dillonjoshua68 The amount of 10 year old pytards here is astounding.
I guess so @Jakman
@Jakman, what do you suggest I learn after augmenting my skills in python?
Cpp (I rlly like it) or NodeJs, or Ruby?
@dillonjoshua68 Either Java or C. Be prepared for headache.
I sure will be ready... I mean u can understand how newbies struggle a lot in the beginning at python [email protected] I’ll do a comparison between them and choose one
@dillonjoshua68 Be sure to know the concepts of Python well. Not everything is done for you. Python is going to hold your hand in ways you will regret.
Sure, but specifically which concepts? @Jakman Modules?
Matrix, etc... @Jakman
@dillonjoshua68 OOP,Auto GC, dynamic typing, etc...
Oh ok, thanks, currently I’m doing OOP @Jakman
What about recursive function? @Jakman
@dillonjoshua68 keep learning Python.
@dillonjoshua68 Lol noone uses recursion.
So recursion is pretty useless? @Jakman
I’m interested in cybersecurity, what bout u? @Jakman
@dillonjoshua68 nah. I do not like DevOps. The military will make you their slave man.
Oh ok lol, idk I’m gonna pursue ethical hacking, but I’m also opting for Machine [email protected]
@dillonjoshua68 Alright. Learn your basics first. Also ML makes you learn a lot of math. (including Calculus)
Oh ok, I guess I could do that, since I’m set 1 maths, so we’re doing higher level maths @Jakman