I would like to take in arguments from the c++ project properties where you can type in your command arguments there.However the output tend to show only the first character of the word.
The parameters that i have placed in the command arguments is 34567 5 6.
The output for the code below only gives me 3 rather than 34567.
Appreciate if anyone out there could enlighten me.
Thanks!
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
cout << *argv[0];
I've never used command-line arguments in C++, but my guess is that since you are only outputting the first character in *argv you're only going to get one character.
It's not an array of strings, so you'll have to use more than the first value.