<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Moayed Ellah</title>
    <description>The latest articles on DEV Community by Moayed Ellah (@moayedellah).</description>
    <link>https://dev.to/moayedellah</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F786028%2Fe9f4b40f-c9af-48e2-a251-3d2e990f2fd9.png</url>
      <title>DEV Community: Moayed Ellah</title>
      <link>https://dev.to/moayedellah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moayedellah"/>
    <language>en</language>
    <item>
      <title>Basic C++ syntax and structure</title>
      <dc:creator>Moayed Ellah</dc:creator>
      <pubDate>Wed, 11 Jan 2023 17:08:01 +0000</pubDate>
      <link>https://dev.to/moayedellah/basic-c-syntax-and-structure-4293</link>
      <guid>https://dev.to/moayedellah/basic-c-syntax-and-structure-4293</guid>
      <description>&lt;p&gt;In this lesson, I'll show you how C++ is written and by the end, you'll be writing your first programme.&lt;/p&gt;

&lt;p&gt;All the resources will be posted on this &lt;a href="https://github.com/Moayed-Ellah/Unleashing-C-From-Basic-to-Advanced/blob/Main/Unit%201:%20Introduction%20to%20C%2B%2B/Basic%20C%2B%2B%20syntax%20and%20structure.md"&gt;github repo&lt;/a&gt;, such as pdfs, exams, assessments, and code.&lt;/p&gt;

&lt;h2&gt; Notes &lt;/h2&gt;

&lt;p&gt;By the end of this lesson, you should be able to:&lt;br&gt;&lt;br&gt;
Understand the basic file structure of a C++ program, including the role of the main() function.&lt;br&gt;
Write, compile, and execute a simple "Hello, World!" program.&lt;br&gt;
Develop your first C++ game.&lt;/p&gt;

&lt;p&gt;Now, after this brief introduction let's start by knowing how to set up our environment.&lt;/p&gt;

&lt;p&gt;To start, open your preferred text editor. In my case, I'm using Visual studio code.&lt;br&gt;
Create a new file and name it "main.cpp" where main is just the name of the file and "CPP" is the extension of the file, c plus plus&lt;/p&gt;

&lt;p&gt;Now let's write our first piece of code and break it down.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ygVoJU3P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1msubvp9kkgqdm7ocit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ygVoJU3P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1msubvp9kkgqdm7ocit.png" alt="cout" width="880" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;line 1&lt;/strong&gt; we have what we call a pre-processor, &lt;em&gt;&lt;code&gt;#include&lt;/code&gt;&lt;/em&gt; itself is used to import functions and code from another file, this is used to let us use functions that we or other developers wrote before. &lt;/p&gt;

&lt;p&gt;Whenever the compiler encounters a pre-processor which in our case is &lt;em&gt;&lt;code&gt;#include&lt;/code&gt;&lt;/em&gt;, it searches for the corresponding file that is written between the &amp;lt;&amp;gt; and goes to that file, retrieves all the code, and writes it in the header of our file, on the very top of our page.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;/code&gt;&lt;/em&gt; is used to import the basic input/output functions such as reading user input and printing output to the console.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;line 3&lt;/strong&gt; we started our actual program by writing the main function. This is the entry point of our programme. We use the main function to organise our code as it is the indicator of where our programme starts its execution process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;line 3&lt;/strong&gt; This is the actual step where we print out our first output, "Hello, world", &lt;code&gt;std::cout &amp;lt;&amp;lt; "Hello, world";&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;cout is the way for us to print something to the console, and it is spelt as &lt;em&gt;see-out&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; operator is known as the insertion or put-to operator. &lt;strong&gt;be careful not to mix it up with the shift operators&lt;/strong&gt;, they're both very similar. They're the same, but when it is used with cout it takes the value on the right and puts it to the value on the left, and in this case, we take the "Hello, world" string and pass it to the cout function for it to print it out.&lt;/p&gt;

&lt;p&gt;Finally, we &lt;em&gt;&lt;code&gt;return 0&lt;/code&gt;&lt;/em&gt; as an indication of the successful execution of the program.&lt;/p&gt;

&lt;p&gt;Ah, finally, this was boring. Let's spice it up. I was thinking of a simple program that prints out two strings, not only one, but my problem is... how? but before that, let's have a general review of what we covered that could help us.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;usage&lt;/th&gt;
&lt;/tr&gt;

&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;pre&gt;#include &amp;lt; iostream &amp;gt; &lt;/pre&gt;&lt;/td&gt;
    &lt;td&gt;
     &lt;code&gt;Used to import the standard input and output functions&lt;/code&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
    &lt;tr&gt;

    &lt;td&gt;&lt;pre&gt;int main()&lt;/pre&gt;&lt;/td&gt;
    &lt;td&gt;
     &lt;code&gt;Our main entry for the execution of the code&lt;/code&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;pre&gt;std::cout&lt;/pre&gt;&lt;/td&gt;
    &lt;td&gt;
     &lt;code&gt;used to print something to the console&lt;/code&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now that you've learned how to print something for the console, what about getting something from the console?&lt;/p&gt;

&lt;p&gt;Maybe you already figured it out, we used c-out &lt;code&gt;cout&lt;/code&gt; to print something... maybe there's c-in &lt;code&gt;cin&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Well, yes, there's a &lt;code&gt;cin&lt;/code&gt; and to our fortune, it's pretty similar to how &lt;code&gt;cout&lt;/code&gt; works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YglKpBn4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/te6sg87bhpdvdiw7ogqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YglKpBn4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/te6sg87bhpdvdiw7ogqe.png" alt="cin" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See? it's not that big of a difference they work similarly to each other, std::cin as of a way to take in input from the user instead of printing out.&lt;/p&gt;

&lt;p&gt;But here we used &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; instead of &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; but it works the same, just the other way around. Instead of taking the value on the right and assigning it or putting it in the value on the left, we here, take the value on the left, which is our input &lt;code&gt;cin&lt;/code&gt; and put it in the value on the right. Which is our age variable.&lt;/p&gt;

&lt;p&gt;so if we type in &lt;code&gt;20&lt;/code&gt; as our input, the variable &lt;code&gt;age&lt;/code&gt; will be assigned this value and would act as if it is 20.&lt;/p&gt;

&lt;p&gt;There's an easy way to differentiate between both, apart from the in and out, you can imagine it as an arrow, wherever the arrow is being shot at is where it is going to put its value in, and wherever it's shot from, it takes the value behind it with it.&lt;/p&gt;

&lt;p&gt;this was the very basic input and output of C++, there'll be a small test on the github &lt;a href="https://github.com/Moayed-Ellah/Unleashing-C-From-Basic-to-Advanced"&gt;repo&lt;/a&gt; along with an assignment of a small project.&lt;/p&gt;

&lt;p&gt;If you have any questions, feedback or would like to know more about me. &lt;br&gt;
you can reach me out on my &lt;a href="https://www.linkedin.com/in/moayedellah/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://github.com/Moayed-Ellah"&gt;github&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Unleashing C++: From Basic to Advanced</title>
      <dc:creator>Moayed Ellah</dc:creator>
      <pubDate>Wed, 11 Jan 2023 17:06:50 +0000</pubDate>
      <link>https://dev.to/moayedellah/unleashing-c-from-basic-to-advanced-1jb9</link>
      <guid>https://dev.to/moayedellah/unleashing-c-from-basic-to-advanced-1jb9</guid>
      <description>&lt;h2&gt;Table of Contents&lt;/h2&gt;

&lt;ul&gt;

&lt;li&gt;Course Description&lt;/li&gt;

&lt;li&gt;Instructor Information&lt;/li&gt;

&lt;li&gt;Course Scope&lt;/li&gt;

&lt;li&gt;Course Format&lt;/li&gt;

&lt;li&gt;Course Schedule&lt;/li&gt;

&lt;li&gt;Prerequisites&lt;/li&gt;

&lt;li&gt;Learning Outcomes&lt;/li&gt;

&lt;li&gt;Assessments&lt;/li&gt;

&lt;li&gt;Technical Requirements&lt;/li&gt;
  
&lt;li&gt;License&lt;/li&gt;

&lt;/ul&gt;

&lt;h2 id="course-description"&gt;Course Description&lt;/h2&gt;

&lt;p&gt;This comprehensive C++ course is designed to provide a solid foundation in the C++ programming language. It covers all of the essential C++ topics, including basic syntax, data types, control flow, functions, classes and objects, and templates. The course also delves into more advanced concepts such as memory management, exception handling, and advanced template techniques.&lt;/p&gt;

&lt;h2 id="instructor-information"&gt;Instructor Information&lt;/h2&gt;

&lt;p&gt;I am a software developer and a student at a community college. I have worked on projects for over six years, including system software, website development, and AI applications. I am passionate about learning and sharing my knowledge with other students. I am excited to do this through this course.&lt;/p&gt;

&lt;h2 id="course-scope"&gt;Course Scope&lt;/h2&gt;

&lt;p&gt;In this course, we will begin by introducing you to the C++ development environment and the basic syntax of the language. As we progress, you will learn about variables and data types, control flow and looping constructs, functions and arrays, and pointers. We will then delve into object-oriented programming in C++ and cover topics such as classes, objects, inheritance, polymorphism, and operator overloading. You will also learn about templates, the Standard Template Library (STL), input/output, file processing, and exception handling. Additionally, we will cover some of the new features and improvements such as automatic type inference, lambda functions, move semantics, and the Concurrency and Parallelism library.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th&gt;Unit&lt;/th&gt;
    &lt;th&gt;Description&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href="https://github.com/Moayed-Ellah/Unleashing-C-From-Basic-to-Advanced/tree/Main/Unit%201:%20Introduction%20to%20C%2B%2B"&gt;Unit 1: Introduction to C++&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;
      &lt;ul&gt;
        &lt;li&gt;Basic C++ syntax and structure&lt;/li&gt;
        &lt;li&gt;Compiling and executing C++ programs&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Unit 2: Variables and Data Types&lt;/td&gt;
    &lt;td&gt;
      &lt;ul&gt;
        &lt;li&gt;Understanding basic data types in C++&lt;/li&gt;
        &lt;li&gt;Creating and initializing variables&lt;/li&gt;
        &lt;li&gt;Typecasting and type conversion&lt;/li&gt;
        &lt;li&gt;Constants and defined variables&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Unit 3: Control Flow and Looping&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Conditional statements (if, else, switch)&lt;/li&gt;
      &lt;li&gt;Looping constructs (for, while, do-while)&lt;/li&gt;
      &lt;li&gt;Jump statements (break, continue, goto)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Unit 4: Functions and Arrays&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Creating and calling functions&lt;/li&gt;
      &lt;li&gt;Understanding function parameter passing&lt;/li&gt;
      &lt;li&gt;Using arrays and array manipulation&lt;/li&gt;
      &lt;li&gt;Strings and string manipulation&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Unit 5: Pointers and Memory Management&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Understanding pointers and the memory model&lt;/li&gt;
      &lt;li&gt;Dynamic memory allocation and deallocation&lt;/li&gt;
      &lt;li&gt;Pointers to objects and classes&lt;/li&gt;
      &lt;li&gt;Smart pointers and reference counting&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Unit 6: Object-Oriented Programming&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Understanding classes and objects&lt;/li&gt;
      &lt;li&gt;Inheritance and polymorphism&lt;/li&gt;
      &lt;li&gt;Operator overloading and friend functions&lt;/li&gt;
      &lt;li&gt;Abstract classes and pure virtual functions&lt;/li&gt;
&lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Unit 7: Templates and Standard Template Library (STL)&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Understanding templates and function templates&lt;/li&gt;
      &lt;li&gt;Understanding class templates and generic programming&lt;/li&gt;
      &lt;li&gt;Standard Template Library (STL)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Unit 8: Exception Handling, Input/Output, and File Processing&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Understanding exception handling and try-catch blocks&lt;/li&gt;
      &lt;li&gt;Input/output streams and file handling&lt;/li&gt;
      &lt;li&gt;Manipulating files and directories&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Unit 9: Advanced C++ Features and Improvements&lt;/td&gt;
  &lt;td&gt;
    &lt;ul&gt;
      &lt;li&gt;Automatic type inference and type deduction&lt;/li&gt;
      &lt;li&gt;Lambda functions and closures&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The content of this course is made available along with other resources such as question, assignments, and any additional valuable resources on this github &lt;a href="https://github.com/Moayed-Ellah/Unleashing-C-From-Basic-to-Advanced"&gt;repo&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="course-format"&gt;Course Format&lt;/h2&gt;

&lt;p&gt;This course is offered online and self-paced. Each lesson is approximately 1 hour in length, and the course will take approximately 25 hours to complete. You can take the course at your own pace and complete it on your own schedule.&lt;/p&gt;

&lt;h2 id="course-schedule"&gt;Course Schedule&lt;/h2&gt;

&lt;p&gt;The course is available for enrollment at any time. Each lesson will be released weekly, and there will be a deadline for each assignment and project. The deadlines for each assignment will be provided in the course.&lt;/p&gt;

&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;To make the most out of this course, you should have a basic understanding of programming concepts, and a good understanding of computers and operating systems. Additionally, you should be familiar with text editors and have a strong desire to learn and grow as a C++ developer.&lt;/p&gt;

&lt;h2 id="learning-outcomes"&gt;Learning Outcomes&lt;/h2&gt;

&lt;ul&gt;

  &lt;li&gt;Understand the basics of C++ programming, including data types, control flow, and functions&lt;/li&gt;

  &lt;li&gt;Write, test, and debug C++ programs using an integrated development environment&lt;/li&gt;

  &lt;li&gt;Implement object-oriented programming concepts such as classes, objects, inheritance, and polymorphism&lt;/li&gt;

  &lt;li&gt;Use templates and the Standard Template Library (STL) to write generic, reusable code&lt;/li&gt;

  &lt;li&gt;Understand advanced topics such as exception handling, input/output, and file processing&lt;/li&gt;

  &lt;li&gt;Use the new features and improvements in C++11/14/17/20&lt;/li&gt;

&lt;/ul&gt;

&lt;h2 id="assessments"&gt;Assessments&lt;/h2&gt;

&lt;p&gt;you will be assessed through a combination of quizzes, assignments, projects, and a final exam. The quizzes will be based on the material covered in the lessons, while the assignments and projects will give you the opportunity to apply your knowledge in a real-world context. After each unit you'll be assigned a project to test your understanding, along with a pdf that includes questions on each topic we covered.&lt;/p&gt;

&lt;h2 id="technical-requirements"&gt;Technical Requirements&lt;/h2&gt;

&lt;ul&gt;

  &lt;li&gt;A computer with an internet connection&lt;/li&gt;

  &lt;li&gt;A modern web browser&lt;/li&gt;

  &lt;li&gt;A text editor (such as Visual Studio Code or Sublime Text)&lt;/li&gt;

  &lt;li&gt;A C++ compiler (such as GCC or Clang)&lt;/li&gt;

&lt;/ul&gt;

&lt;h2 id="license"&gt;Licence&lt;/h2&gt;

&lt;p&gt;This course is released under the MIT Licence, which means that you can use, modify, and redistribute the materials as long as you give me credit and include a copy of the licence.&lt;/p&gt;

&lt;p&gt;If you have any questions, feedback or would like to know more about me. &lt;/p&gt;

&lt;p&gt;you can reach me out on my &lt;a href="https://www.linkedin.com/in/moayedellah/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>devjournal</category>
    </item>
  </channel>
</rss>
