C++ Programming Talk

C, C++, Visual C++, C++.Net Topics
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: C++ Programming Talk

Post by Nipuna » Wed Aug 25, 2010 7:52 pm

Neo wrote:Sorry, I don't use Dev C++. I use VC++ 6 and C++.Net. You'll have to find a good example project that runs on Dev C++.

However, I'm wondering whether it is good to move to GUI before completing the first parts of the tutorial. GUI is the final bit. Start learning the concepts from the beginning. Finally you can come to GUI with some help from a good IDE like VC++.
I won't move to GUI now. I will move to GUI after learning first things.
I asked you a code Just for curious if you are busy give it to me later

Thanks.
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: C++ Programming Talk

Post by Nipuna » Wed Oct 13, 2010 7:54 pm

Hey Friends.

I Wrote a Little Program Today at my Little free time. I don't have much time these days because I am in Middle of Freelancer Projects .

I am Very Happy Because I wrote all by my self without looking at Tutorials. Except one thing that is How to make a New Line. ;) :D :D

Here is the Code

Code: Select all

#include<iostream>
#include<string>
using namespace std;
int main ()
{
    int a; //integer
    int b;
    int c;
    
    string word="This is a Test with All";
    cout <<word<<endl;
    cout <<"enter a number for a: \n";
    cin >>a;
    cout <<"enter a number for b \n";
    cin >>b;
    cout<<"Now it will be Multiplied And you will see the Result Below \n";
    cin.get();
    c = a*b;
    cout<<c<<endl;
    cout<<"Thanks for Using my Program!  :) :) \n";
    cin.get();
    return 0;
}    
But I have a Little Problem that is How to run Another Program Via my Program. For now I want to run a .Bat file.

And other thing that is i can't use this

Code: Select all

int main (int argc, char *argv{})
Code on Dev C++. it says this

Code: Select all

C:\Users\Nipuna Dananjaya\Desktop\Test.cpp:4: error: expected `,' or `...' before '{' token
But work well with

Code: Select all

int main ()
Thanks. :)
User avatar
Herath
Major
Major
Posts: 417
Joined: Thu Aug 05, 2010 7:09 pm

Re: C++ Programming Talk

Post by Herath » Wed Oct 13, 2010 8:02 pm

Code: Select all

int main (int argc, char *argv[])
use square brackets to declare argument array
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: C++ Programming Talk

Post by Neo » Wed Oct 13, 2010 8:24 pm

To execute an external program, try system("command");
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: C++ Programming Talk

Post by Nipuna » Wed Oct 13, 2010 8:38 pm

Thanks Thanks Thanks Buddies :D :D :D :D

The two things you said Worked well.

Thanks.

I will ask more help in the future when i start to learn. :D .Today i only Checked my Memory. :)

Thanks you Guys are the Best :D :D
Post Reply

Return to “C/C++ Programming”