Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,395 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,125 people online right now. Registration is fast and FREE... Join Now!




C++ linking programs

 
Reply to this topicStart new topic

C++ linking programs, Help with linking C++ programs

nosurvivorz
29 Sep, 2006 - 06:17 AM
Post #1

New D.I.C Head
*

Joined: 29 Sep, 2006
Posts: 1


My Contributions
I have this code

CODE
//Password
#include<iostream>
#include<fstream>
#include<conio.h>

using namespace std;

void Auth();
void Members();
void Userchange();
void Passchange();

string inuser;
string inpass;
string user;
string pass;
int num = 0;
string com;

main()
{
      system("cls");
      cout<<"Welcome\n---------------------------\n\n";
      while(num==0)
      {
      system("cls");
      cout<<"Command: ";
      cin>>com;
      if(com=="login")
      {
      Auth();
      }
      else if(com=="change-pass")
      {
           Passchange();
           }
      else if(com=="change-user")
      {
           Userchange();
           }
      else if(com=="credits")
      {
           cout<<"written by Jason Parker"; // cuz it was
           }
      else if(com=="exit")
      {
           cout<<"written by Cipherence SoftWurx";
           getch();
           break;
           }
      else if(com==com)
      {
           cout<<"Unknown command\n";
           }
      }
}
void Auth()
{
     ifstream Passfile("password.txt", ios::in);
     Passfile>>inpass;
     ifstream Userfile("username.txt", ios::in);
     Userfile>>inuser;
     system("cls");
     cout<<"USERNAME: ";
     cin>>user;
     cout<<"PASSWORD: ";
     cin>>pass;
     Userfile.close();
     Passfile.close();
     if(user==inuser&&pass==inpass)
     {
     cout<<"\nHit enter to continue to members area";
     getch();
     Members();
     }
     else
     {
         cout<<"nope";
         getch();
         main();
         }
}
void Userchange()
{
     string tempass;
     system("cls");
     cout<<"enter current password: ";
     cin>>tempass;
     if(tempass==inpass)
     {
     cout<<"utility to change username stored in file\n";
     cout<<"CHANGE USER TO: ";
     cin>>user;
     ofstream Userfile("username.txt", ios::out);
     Userfile<<user;
     Userfile.close();
     cout<<"Username successfully changed";
     getch();
     main();
}
else
{
    cout<<"Invalid Password";
    getch();
    main();
}
}
void Passchange()
{
     string tempass;
     system("cls");
     cout<<"enter current password: ";
     cin>>tempass;
     if(tempass==inpass)
     {
     cout<<"utility to change password stored in file\n";
     cout<<"CHANGE PASS TO: ";
     cin>>user;
     ofstream Passfile("password.txt", ios::out);
     Passfile<<user;
     Passfile.close();
     cout<<"password successfully changed";
     getch();
     main();
}
else
{
    cout<<"Invalid Password: ";
    getch();
    main();
}
}
void Members()
{
     cout<<"nothing";// put members code here
     // like a while(){} loop or somethin like that
     // comment please
}


and i was wondering if anywon new a command that would make that program talk to another one and have the other program launch this one

thanks
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: C++ Linking Programs
29 Sep, 2006 - 09:50 AM
Post #2

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Yes Sure...Normally for industry-level applications, if a lot of data has to be transferred in duplex mode, Socket Programming is used..

But in your case, simply pass the data that you want to pass to the next program as it's command line arguments.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 02:47AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month