Re: New at c++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lopezio,

> I program in Pascal with parameters and my programs run like
> nameofprogram.exe param1 param2
> How can i do the same in c++?

Your question is off-topic for this forum.  This is a GCC specific help
forum, and your question is a general C++ question.  I'm not pointing this
out to chastise you.  I'm pointing it out because there are more suitable
forums for general C++ questions, with which you may be able to get answers
to your general C++ questions faster and/or more accurately.

That being said...

#include <iostream>
int main(int argc, char** argv)
{
  for(int i = 1; i < argc; ++i)
  {
    std::cout << "Parameter " << i << ": "
      << argv[i] << std::endl;
  }
}

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux