Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8775291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:46:07+00:00 2026-06-13T18:46:07+00:00

Code: #include <stdio.h> #include <stdlib.h> #include <unistd.h> struct subscriber { char phonenumber[20]; char name[50];

  • 0

Code:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

struct subscriber {
    char phonenumber[20];
    char name[50];
    float amount;
} s;

void addrecords();
void listrecords();
void modifyrecords();
void deleterecords();
void searchrecords();
void payment();

char get;

int main()
{
    int password;
    int phonenumber;
    char choice;

    system("cls");

    printf
    ("\n\n\n\n\n\n\n\n\n**********************************************************************");
    printf("\n\t\t---WELCOME TO THE TELECOM BILLING MANAGEMENT SYSTEM---");
    printf("\n\t\t****************************************************************");

    Sleep(2000);

    getch();

    system("cls");

    while (1) {
        system("cls");
        printf("\n enter\n A : for adding new records.\n L : for list of records");
        printf("\n M : for modifying records.\n P : for payment");
        printf("\n S : for searching records.");
        printf("\n D : for deleting records.\n E : for exit\n");

        choice = getche();
        choice = toupper(choice);

        switch (choice) {
        case 'P':
            payment();
        break;

        case 'A':
            addrecords();
            break;

        case 'L':
            listrecords();
            break;

        case 'M':
            modifyrecords();
            break;

        case 'S':
            searchrecords();
            break;

        case 'D':
            deleterecords();
            break;

        case 'E':
            system("cls");
            printf("\n\n\t\t\t\tTHANK YOU");
            printf("\n\n\n\n\n:\n\tFOR USING OUR SERVICE");
            Sleep(2000);
            exit(0);
            break;

        default:
            system("cls");
            printf("Incorrect Input");
            printf("\nAny key to continue");
            getch();

        }

    }

}

Error:

proj.c:(.text+0x53): undefined reference to `Sleep'
proj.c:(.text+0x5d): undefined reference to `getch'
proj.c:(.text+0xbb): undefined reference to `getche'
proj.c:(.text+0x17f): undefined reference to `Sleep'
proj.c:(.text+0x1c1): undefined reference to `getch'
/tmp/cc4UYi0H.o: In function `addrecords':
proj.c:(.text+0x244): undefined reference to `getch'
proj.c:(.text+0x340): undefined reference to `getche'
/tmp/cc4UYi0H.o: In function `listrecords':
proj.c:(.text+0x44c): undefined reference to `getch'
/tmp/cc4UYi0H.o: In function `deleterecords':
proj.c:(.text+0x5b2): undefined reference to `getch'
proj.c:(.text+0x632): undefined reference to `getch'
/tmp/cc4UYi0H.o: In function `searchrecords':
proj.c:(.text+0x791): undefined reference to `getch'
/tmp/cc4UYi0H.o: In function `payment':
proj.c:(.text+0xb1f): undefined reference to `getch'
collect2: ld returned 1 exit status

I tried the solution given here ( Undefined reference to "sleep" but I did include <unistd.h> ) but it’s still not working. I am using gcc on Ubuntu 12.04.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:46:08+00:00Added an answer on June 13, 2026 at 6:46 pm

    Your code seems to come from Windows operating system. On Linux, the function Sleep does not exist (Sleep is a function from Windows API!). Try sleep (from <unistd.h>) instead. As alk said, keep in mind the arguments of Sleep and sleep are different:

    • Sleep takes a time in milliseconds;
    • sleep takes a time in seconds.

    Likewise, the getch function and the cls shell command don’t work with GNU/Linux.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

fifo.3 source code: #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include
Client code: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h>
I have done the following code. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h>
My C code #include <stdio.h> #include <stdlib.h> #include help.h int test(int x, P *ut)
I have the following code: #include <stdlib.h> #include <stdio.h> #include <pthread.h> #define NUM_THREADS 100
I have the next C code: #include <stdio.h> #include <stdlib.h> #include list.h #include graph.h
Please see this piece of code: #include<stdio.h> #include<string.h> #include<stdlib.h> int main() { int i
I am trying to understand the following code: #include<stdio.h> #include<stdlib.h> #include<sys/io.h> #define baseport 0x378
I'm trying to use SendInput() function. I wrote this code: #include <stdio.h> #include <stdlib.h>
In the code below i was expecting another output! : #include <stdio.h> #include <stdlib.h>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.