MSMohammed Sohailinmsohail22-cpp.hashnode.dev·Jan 14 · 2 min readfgets vs getline: Which Function to Use and WhyBoth methods are used to take input in C++, and we can use either one. But why do we need a distinction between these two methods? The reason is that when we use fgets, we can see how memory is allocated. To understand this more clearly, let's look a...00
MSMohammed Sohailinmsohail22-cpp.hashnode.dev·Jan 13 · 3 min readHow to Use Command Line Arguments EffectivelyThe most basic command-line argument program is #include <iostream> using namespace std; int main(int argc, char *argv[]) { return 0; } To run this program, we can follow the usual steps for running a C++ program. What does this program do? It si...00
MSMohammed Sohailingas-asm.hashnode.dev·Jan 6 · 1 min readLearning GNU Assembly (AT & T syntax)Return 0 in assembly How to Return a Custom Exit Code in Your Program How to Write a Hello World Program in Assembly Language00
MSMohammed Sohailingas-asm.hashnode.dev·Jan 6 · 4 min readHow to Write a Hello World Program in Assembly LanguageNow, let's look at the traditional "hello, world" program in programming. I'm not a big fan of it, but it's basic and helps us see the output on the terminal for the first time, so it's fine here. Below is a simple C++ code example, which is consider...00
MSMohammed Sohailingas-asm.hashnode.dev·Jan 6 · 1 min readHow to Return a Custom Exit Code in Your ProgramAnother simple program involves returning a specific number instead of the usual 0. Here is the equivalent code in C++ for that: #include <iostream> using namespace std; int main() { return 5; } The same code we used to return 0 in assembly wil...00