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

  • SEARCH
  • Home
  • 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 7183321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:57:22+00:00 2026-05-28T17:57:22+00:00

Write an intelligent editor to simulate the following: While typing if a new word

  • 0

Write an intelligent editor to simulate the following:

While typing if a new word starts with the same letters as that of some previously typed word, the choice of selecting the word instead of typing the whole should be given.
This is my homework.

My Algorithm :

1: Read the input by everytime checking the _kbhit() macro.
2: Store the word in an array
3: On every further read, check the array if the word exists.

Now the problem occurs!!!

How do I give the user an option to select the word or not???
And even if giving option is successful, how do I know wether user has decided to opt for that word?

I am new to this style of programming. Anyone knows how to do this, Please help me out…

  • 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-05-28T17:57:23+00:00Added an answer on May 28, 2026 at 5:57 pm

    It depend on how do you read the input, and communicate with the user. If it’s just a terminal, I suggest you to define one key (probably tab or esc) to move to choosing state, and then let him (for example) hit a number (or keys).

    Edit: some code:

    char c=getchar();
    //some of your proccessing...
    if (c=='\t') {
     printf("\nPlease select option (0 to abort)\n");
     char **op;
     int n,i;
     //calculate the options, assign them to op and n.
     for (i=0;i<n;i++) printf("%d: %s\n",i+1;op[i]);
     i=n+1;
     while (i<0 || i>n) scanf("%d",&i);
     if (i>0) {
      //do whatever you need. remember to use i-1
     }
    }
    //reprint the whole string.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a PHP-MySQL database processor that is somewhat intelligent. When
I want to write some code that need to use artificial intelligence. I dont
Write a class ListNode which has the following properties: int value; ListNode *next; Provide
Please write a list of tasks that a copy constructor and assignment operator need
I write a large static method that takes a generic as a parameter argument.
I write a Text Editor with Java , and I want to add Undo
My aim is to write an intelligent ChatBot. He should save known informations likely
Write a function that counts the number of elements in the list that are
I'm going to write my own custom control that is very different from UIButton.
Write a program that calculates Euler’s number e. To do this, first write a

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.