> 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."
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.
@adityaru @Muskan786 @DamienKilduff @AshishSarkar @mkhoi @TheForArkLD @DigitCommander @Jakman @Muffinlavania @WhyMe2 @awesome10 @DannyIsCoding @SpaceFire Day 5 is OUT!
@HahaYes I am going in for the judges opinon
@Jakman what do you mean
@HahaYes lol wait is @WhyMe2 your alt?
@Muffinlavania yes.... also day 5 is out
@Muffinlavania it is a bot
@Muffinlavania dang muffin you are gaining
@HahaYes wait day 5 is out???? I had no idea?? Also i was gonna ask y u literally answered right away, but ur sick right :(
@HahaYes wat, im cool now :D
@Muffinlavania yes why not just comment
@Muffinlavania yeah, check it out, you are on the top 10
@HahaYes AYYYYY LEADERBOARD BOISSSSSSSSSSSSSSSSSSSSS
@HahaYes but i probably am gonna not post stuf so likeeeeee cya
@Muffinlavania AYYYYY CHECK OUT MY DAY 5
@Muffinlavania check out day 5 first
@HahaYes omg ok ok
@Muffinlavania we need to beat @CodeLongAndPros
@HahaYes OMG lolllll you cant stop advertising can ya
@HahaYes well he hacker boi and you kinda just brought him over here by the mention :(
@Muffinlavania nope
@HahaYes I can hear you.
@HahaYes SO umm @CodeLongAndPros your the best yay
@Muffinlavania oh well, he is offline
@CodeLongAndPros wait wait he is online ABORT ABORT ABORT
@Muffinlavania no no no no
@HahaYes shrug idk if you want i can stop talking if you are doing something
@Muffinlavania lol just go see day 5 and upvote
@HahaYes ......
@HahaYes And I've bookmarked this page.
@Muffinlavania oof oof DAY 5
@CodeLongAndPros ABORT ABORT ABORT
@HahaYes omg stop geeeeeeeeeeeeeeeeeeeeeez
@Muffinlavania oh no i have lost another comrade
@Muffinlavania hehe truck go boom boom
@HahaYes ...
@Muffinlavania hmmm free advertisement day 5 is OUT
@HahaYes
https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757https://repl.it/talk/learn/C-Tutorial-Day-5/42757
@HahaYes ya happy
@Muffinlavania the link broke
@Muffinlavania anyways, actually go check out day 5, ima be sick
Your move, @HahaYes
@HahaYes arent you sick..... and also i did and upvoted, but likeeeeee my mommy said to watch out for baddies online
Hopefully you know im kidding
@CodeLongAndPros wdym ABORT ABORT ABORT see ya
@HahaYes export mailto=/etc/crontab
@HahaYes E