[sourcecode language="cpp"]
#include <iostream>
using namespace std;
int main( int argc, char **argv )
{
//for taking command line arguments
bool numFound=false;
char myCharArray[10];
int x=argc;
int y;
cout <<"You entered "<<x-1 <<" parameters after the command \"commandLine.\""<<endl;
cout <<"They were: ";
for (int i=1; i<x; i++)
{
strcpy(myCharArray, argv[i]);
cout <<myCharArray<<" ";
}
cout<<endl;
for (int i=1; i<x; i++)
{
strcpy(myCharArray, argv[i]);
if(isdigit(myCharArray[0]))
{
if(numFound==false)
cout<<"The number(s) you entered were: ";
numFound=true;
y=atoi(argv[i]);
cout <<y<<" ";
}
}
cout <<endl;
}
[/sourcecode]
Subscribe to:
Post Comments (Atom)
How to enable CORS in Laravel 5
https://www.youtube.com/watch?v=PozYTvmgcVE 1. Add middleware php artisan make:middleware Cors return $next($request) ->header('Acces...
-
< Requirements Java Development Kit (JDK) NetBeans IDE Apache Axis 2 Apache Tomcat Server Main Topics Setup Development Environ...
-
Download Sourcecode [sourcecode language="csharp"] using System; using System.Collections.Generic; using System.Linq; using System...
No comments:
Post a Comment