Help me with these codes please? ASAP

This is a discussion on Help me with these codes please? ASAP within the C Programming forums, part of the General Programming Boards category; The Program's running up to the end but crashes when i'm going to press a key when going to input ...

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    1

    Help me with these codes please? ASAP

    The Program's running up to the end but crashes when i'm going to press a key when going to input a letter to the Enter Position:Here's the codes:
    Code:
    #include #include #include using namespace std;#define p printf#define s scanf_sint main (){    int Hours, Gross;    char Position;    char Name[100];    p("EMPLOYYEE'S RECORD \n");    p("Name: ");    s("%s", &Name);    p("Manager Supervisor Employee \n");    p("Enter Position: ");    s("%c", &Position);    /*if ((Position=='M') || (Position=='m'))    {        p("Rate: 500\n");        p("No. of Hours Worked: ");        s("%d", &Hours);        Gross=Hours*500;        p("Gross: %d\n", Gross);    }*/    /*else if ((Position=='S') || (Position=='s'))    {        p("Rate: 400\n");        p("No. of Hours Worked: ");        s("%d", &Hours);        Gross=Hours*400;        p("Gross: %d\n", Gross);    }*/    /*else if ((Position=='E') || (Position=='e'))    {        p("Rate: 300\n");        p("No. of Hours Worked: ");        s("%d", &Hours);        Gross=Hours*300;        p("Gross: %d\n", Gross);    }*/    /*else        p("Invalid");*/        system("pause>0");}
    Many Thanks!

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,323
    Your code didn't paste properly

    Make sure that you paste as plain text.

    However, I can see one problem: "using namespace std" is c++, and this is a c board
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help asap
    By Kelz McClure in forum C++ Programming
    Replies: 8
    Last Post: 05-01-2012, 10:45 PM
  2. Someone Please Help! ASAP!!
    By CB44 in forum C++ Programming
    Replies: 8
    Last Post: 01-17-2011, 12:13 AM
  3. Need help!!!!!! Asap!!!!!
    By DMJJR1988 in forum C++ Programming
    Replies: 4
    Last Post: 09-16-2010, 01:20 AM
  4. i really need help asap
    By dinesh in forum C Programming
    Replies: 1
    Last Post: 04-24-2003, 11:22 PM
  5. converting scan codes to ascii codes
    By stupid_mutt in forum C Programming
    Replies: 11
    Last Post: 01-25-2002, 03:06 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21