?
What will be the output of the following C++ code if the following arguments are executed on terminal?
What will be the output of the following C++ code if the following arguments are executed on terminal?
===============program.cpp=============
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
for(int i=0;i<argc;i++)
cout<<argv[i]<<"\n";
}
=======================================
================commands===============
$ g++ program.cpp -o output
$ ./output Hello World
=======================================
===============program.cpp=============
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
for(int i=0;i<argc;i++)
cout<<argv[i]<<"\n";
}
=======================================
================commands===============
$ g++ program.cpp -o output
$ ./output Hello World
=======================================
Join the Discussion
Login to post a comment or share your explanation.
Login