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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:23:01+00:00 2026-05-27T13:23:01+00:00

Recently I experienced very strange situation by my C program. Usually my program works

  • 0

Recently I experienced very strange situation by my C program.
Usually my program works fine, but if I add just a few lines to check elapsed time, the result changes.

The code of which result changed is:

while (!feof(pfInputFile) && (c = fgetc(pfInputFile)) != EOF){
    for(i = 1 ; i < SEED_SIZE ; i++){
    pcSeq[i-1] = pcSeq[i];  // Shift left all sequence
    }
    pcSeq[SEED_SIZE - 1] = c;
}

And the code I added and cause a problem is below:

#include <time.h>

time_t start, end;
time(&start); time(&end);

And then, the characters that are read by the above source code are changed to unrecognized character.

  • 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-27T13:23:02+00:00Added an answer on May 27, 2026 at 1:23 pm

    Not enough details but I’ll take a wild guess.

    You returned a pointer to a local variable pcSeq. Then in another function you call time(&start) with the result that the start variable now shares the same stack address that pcSeq had, so it got overwritten.

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

Sidebar

Related Questions

I am very new to Mootools but have good experience in jQuery. Recently i
I have recently programmed a console application and I've experienced a lot of pain
I'm very much new to Test Automation kind of thing. Recently I've been assigned
I am very experienced in working with open-source technologies like PHP, MySQL, Apache and
as the title says i've recently signed my app but found once i signed
I'm a junior developer and recently started working for a very small office where
I recently became quite interested in developing an adobe air application, and just had
Recently I started using WCF, and I was very impressed, so much so ,
I have recently started working on a very large C++ project that, after completing
Let me set the stage here. I'm a very junior developer who's recently made

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.