msohail22-cpp.hashnode.devfgets 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...Jan 14·2 min read
msohail22-cpp.hashnode.devHow 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...Jan 13·3 min read
gas-asm.hashnode.devLearning 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 LanguageJan 6·1 min read
gas-asm.hashnode.devHow 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...Jan 6·4 min read
gas-asm.hashnode.devHow 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...Jan 6·1 min read