Thread: Null pointer assignment

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    8

    Null pointer assignment

    Hi
    I wrote a c program where my input is a file and i store output also in a file. Everything works fine. But in my command prompt it shows null pointer assignment. but my output is not affected. i know about null pointer assignment. but how to detect which part of my pgm is accessing that oth address which causes this error

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by Raghavan View Post
    Hi
    Everything works fine. But in my command prompt it shows null pointer assignment.
    It is not possible for both of these things to be true at the same time. I'm guessing, since you're posting here, that you mean the second one.
    Quote Originally Posted by Raghavan View Post
    how to detect which part of my pgm is accessing that oth address which causes this error
    With a debugger, if you have one. Judicious use of printf statements. Carefully examining your code for memory accesses.

    My Hat of Guessing thinks you are fclose'ing a file twice, but would not be willing to bet any amount of money at any odds that that is actually right.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. "Virtual Printer" or "Moving Printjobs"
    By extasic in forum Windows Programming
    Replies: 12
    Last Post: 06-30-2011, 08:33 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. . . . . . . - . . . - -
    By The Brain in forum C++ Programming
    Replies: 17
    Last Post: 05-17-2005, 04:01 AM
  4. button 'message'
    By psychopath in forum Windows Programming
    Replies: 12
    Last Post: 04-18-2004, 09:57 AM
  5. When do we get Null Pointer Assignment
    By YALINI in forum C Programming
    Replies: 1
    Last Post: 08-29-2001, 01:48 AM