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 8862767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:48:28+00:00 2026-06-14T15:48:28+00:00

void deleteFile( FAT *allotable ) { /* PRECONDITION: This function expects a FAT structure

  • 0
void deleteFile( FAT *allotable ) {
/* PRECONDITION: This function expects a FAT structure that is valid.
 * POSTCONDITION: A file is flagged as removed from the disk and it will 
 * be possible to write over it
 */

    // Local variables
    unsigned char test[9] = { 0 };

    // Select file to remove
    // TODO: The user will select the file to remove based on the 
    // listing in listDir
    // For testing, we are removing file at location 0 in the entry
    fgets( test, NAME_SIZE, stdin );
    return;
}

When I run the function and type in a string, I see the string printed back in stdout. I am sure I have an issue with a buffer, but I can’t seem to figure this 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-06-14T15:48:29+00:00Added an answer on June 14, 2026 at 3:48 pm

    When you type characters into the console, they are echoed back to you. The characters will still be read when you read from stdin.

    Alternatively you can pipe the output of a program into your own, or redirect a file to stdin. In those two cases, the characters will not be echoed:

    echo Program output | ./myprog
    

    or:

    ./myprog < fileinput.txt
    

    edit – Sounds like it’s a terminal problem.

    You haven’t stated what system you are using or how you are interfacing with it, but I can get this behaviour by connecting to a system via SSH with PuTTY.

    I change the terminal settings to force on both “Local echo” and “Local line editing”. Then I get the line echoed whenever I press enter. Obviously only one of those should be on. Preferably “Local echo”.

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

Sidebar

Related Questions

I have this method that gets the last line of a .txt file and
I use this method to compile C++ file in VS. But even i provide
I have this unit test: [Test] public void ProcessDbFile_should_delete_file_if_it_exists_then_copy_new_file_to_same_location() { // used to create
I try to delete file after download file.My code is private void DownloadZipFileDialogue(string strZipFilePath)
I am writing some code that downloads a file from a network resource to
My upload servlet keeps throwing me an exception saying that the file that I'm
void (int a[]) { a[5] = 3; // this is wrong? } Can I
So this is what i'm trying to do, i have a web application that
I am writing an application that involves multiple clients. One client uploads a file
- (void)viewDidLoad{ [super viewDidLoad]; NSString *path = [[NSBundle mainBundle] pathForResource:@VidName ofType:@mov]; NSURL *url =

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.