Thread: Borland vs VStudio 5.0 arg :(

  1. #1
    Shadow12345
    Guest

    Borland vs VStudio 5.0 arg :(

    I am having a lot of trouble. I made a program using Borland C++ version 5.5. I brought that program to school (where I am right now) and tried compiling it under Visual C++ 5.0 but for some reason it does not work. Does that mean my program will not work under Visual C++ 6.0 as well? I am very confused, if you would like me to post my source code I will (it is quite a bit).

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Chances are that you used Borland specific functions that aren't available in MSVC++. The gotoxy function, or textcolor() perhaps?

    -Prelude
    My best code is written with the delete key.

  3. #3
    Shadow12345
    Guest

    Hmm

    No I did not use either of those funcitons. Actually the only things I included seemed to be things that would be included with any standard C++ library. I will list the header files I used:
    #include <iostream>
    #include <string>
    #include <windows>
    #include <cComp> // One of my own


    I think all of these are in the visual C++ include directory, I just need to check spelling and what not.

    I will reply later.

  4. #4
    Shadow12345
    Guest

    ....

    I have gone through and made sure that I had the right spellings and what not of the header files but for some reason I still get like 45 errors...remember this compiled and ran fine on borland C++ 5.5, and I am trying to get it running with Visual C++ 5.0 on another computer...this is weird...
    Here is my source code:
    #include <IOS.H>
    #include <cComp.h>
    #include <STRING.H>
    #include <WINDOWS.H>

    int main()
    {

    Computer Jarrod;

    Jarrod.SetSpeed(1400);
    Jarrod.SetHD(30);
    Jarrod.SetRAM(256);

    Computer Charles;
    Charles.SetSpeed(1400);
    Charles.SetHD(40);
    Charles.SetRAM(512);

    Computer Alfred;
    Alfred.SetSpeed(1200);
    Alfred.SetHD(20);
    Alfred.SetRAM(256);


    unsigned char Al[] = "I like cheese";
    unsigned char Jar[] = "I am mentally retarded";
    unsigned char Char[] = "Blah";
    unsigned char Password[50];
    unsigned char answer[50];
    unsigned char Yes[] = "Yes";
    int x = 10;
    cout << "\nIdentify yourself (Enter password):\n ";
    cin.getline(Password, 50);
    cout << "\nYou have entered: '" << Password << "'";

    cout << "\nWould you like to proceed?\n";
    cin.getline(answer, 50);
    if(!strcmp(answer, Yes))
    {
    cout << "\nYou have chosen to proceed\n";
    Sleep(1000);
    cout << "\nI am now processing your password to see if it was correct\n";
    while (x > 1) { Sleep(500); cout << "."; x--;};
    if(!strcmp(Password, Al))
    {
    cout << "\nYou have been correctly identified as Alfred";
    cout << "\nI am now retrieving information";
    int x = 10;
    while (x > 1) {Sleep(500); cout << "."; x--;};
    cout << "\nAlfred's computer has a ";
    cout << Alfred.GetSpeed();
    cout << "MHz processor" << endl;
    cout << "\nAlfred's computer has a ";
    cout << Alfred.GetHD();
    cout << "GB hard drive" << endl;
    cout << "\nAlfred's computer has ";
    cout << Alfred.GetRAM();
    cout << "MB of RAM" << endl;
    }
    else if(!strcmp(Password, Jar))
    {
    cout << "\nYou have been correctly identified as Jarrod";
    cout << "\nI am now retrieving information";
    int x = 10;
    while (x > 1) {Sleep(500); cout << "."; x--;};
    cout << "\nJarrod's computer has a ";
    cout << Jarrod.GetSpeed();
    cout << "MHz processor" << endl;
    cout << "\nJarrod's computer has a ";
    cout << Jarrod.GetHD();
    cout << "GB hard drive" << endl;
    cout << "\nJarrod's's computer has ";
    cout << Jarrod.GetRAM();
    cout << "MB of RAM" << endl;
    }
    else if(!strcmp(Password, Char))
    {
    cout << "\nYou have been correctly identified as Charles!!!!\n";
    cout << "\nI am now retrieving information";
    int x = 10;
    while (x > 1) {Sleep(500); cout << "."; x--;};
    cout << "\nCharles's computer has a ";
    cout << Charles.GetSpeed();
    cout << "MHz processor" << endl;
    cout << "\nCharles's computer has a ";
    cout << Charles.GetHD();
    cout << "GB hard drive" << endl;
    cout << "\nCharle's computer has ";
    cout << Charles.GetRAM();
    cout << "MB of RAM" << endl;
    }
    else
    cout << "\nYou have not been identified";

    }
    else
    {
    cout << "\nYou have not proceeded";
    Sleep(1000);
    cout << "\nIf there was a delay it worked";
    }
    return 0;
    }

    It is quite a bit but if you see anything that I might be doing wrong please tell me.
    thx

  5. #5
    Shadow12345
    Guest

    error description

    Most of my errors say
    '<<' Bad Right Operand


    This doesn't make sense to me...ask any questions if you need.

    thx

  6. #6
    Shadow12345
    Guest

    NEVERMIND

    Ok I finally got this damn thing to compile correctly. Sorry for the long posts

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >#include <IOS.H>
    should be
    #include <iostream>
    or
    #include <iostream.h>

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer to struct
    By Paul Johnston in forum C Programming
    Replies: 4
    Last Post: 06-11-2009, 03:01 AM
  2. Replies: 10
    Last Post: 06-08-2009, 02:42 PM
  3. Replies: 5
    Last Post: 08-12-2007, 05:26 PM
  4. Ranged numbers
    By Desolation in forum Game Programming
    Replies: 8
    Last Post: 07-25-2006, 10:02 PM
  5. Compiler "Warnings"
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 04-24-2005, 01:09 PM