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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:58:55+00:00 2026-05-27T20:58:55+00:00

Hey I’ve tried a lot of programs in Visual Studio and in most of

  • 0

Hey I’ve tried a lot of programs in Visual Studio and in most of them when i try taking the input from a stream ( while using fscanf ) it invariably throws a debug assertion failed error ..

and goes on to say:

stream != NULL. Since I have gotten this error a number of times .. I assume there is a flaw in the way I’m using fscanf. I would appreciate it if someone could tell me the usage or .. give me a demo sample code that illustrates the simple usage .. !

I tried looking up the error .. in most places it said I haven’t closed the file .. but I have and I’m a little confused .. I appreciate any help .. thanks a lot 🙂

    printf("Enter No of states\n");
     Q=5;
  //  scanf("%d",&Q);

   // READING ZERO MATRIX
  // reading the matrix from f0.sta
 {
  FILE *fp;
   fp = fopen("c:\\tc\\fuzzy\\f0.sta","r");
   for(i=1;i<=Q;i++)
    for(j=1;j<=Q;j++)
     fscanf(fp,"%f",&a0[i][j]);

    fclose(fp);
 }
 // READING ONE MATRIX
 // reading the matrix from f0.sta
   FILE *fp;
    fp = fopen("c:\\tc\\fuzzy\\f1.sta","r");
     for(i=1;i<=Q;i++)
      for(j=1;j<=Q;j++)
        fscanf(fp,"%f",&a1[i][j]);

    fclose(fp);

This is the code bit.

  • 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-27T20:58:56+00:00Added an answer on May 27, 2026 at 8:58 pm

    It sounds like fp is NULL. The most likely reason is that one of the files (or both) do not exist, or can’t be opened (for example, because some other process is using it).

    I would start by adding some error checking after the two fopen() calls: compare the result to NULL and if it is NULL, examine errno.

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

Sidebar

Related Questions

Hey anytime I start up visual studio i get an error popping up in
Hey I just started dabbling with android programming, and from my short period of
hey i followed a ruby on rails guide when i tried to run it
hey There finally I'm create android app and integer ad mob but when try
Hey all. I've been been trying to figure this out for a while now.
Hey guys. This is a follow-on from this question : After getting the right
Hey guys I am doing the application from the book RhoMobile Beginners Guide but
Hey! I try to do the following QList<QButtonGroup*> groups; for (int i=0; i<nGroup; i++)
Hey i have been looking around and i cant find a way to get
Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>

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.