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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:38:39+00:00 2026-05-13T23:38:39+00:00

I m programming C for an assingment in VC++ 2008. I simulate adjList for

  • 0

I m programming C for an assingment in VC++ 2008. I simulate adjList for graph implementation. i can readly add edge between two vertex and print the graph.
and i want to remove edge between two vertex and print the graph again. whatever i do,i cant print the graph after deleting the edge. i get 0xfeefee 🙁 what is this? and how can i resolve this program.

my delete function and print the graph function are illustrated below.

  void deleteEdge(Graph G, Vertex V, Vertex W)
{ 
 Edge list,prev,temp;
 list=V->list;  
  prev=NULL;
  // 
  while(list!=NULL && list->to->value!=W->value){
   prev=list;
   list=list->next;
  }
  // have found the element.
  if(list!=NULL){
   temp=list;
   // if first element of list is deleted.
   if(prev==NULL)
   list=list->next;
   else
   prev->next=list->next;

   // reallocate.
   free(temp);

  }
}




    void GRAPHprint(Graph G)
    {
     Vertex tmp;
     Edge list;
     for(tmp = G->head;tmp!=NULL;tmp=tmp->next)
     {
      fprintf(stdout,"V:%d\t",tmp->value);
      list=tmp->list;
      while(list!=NULL)
      {

       fprintf(stdout,"%d\t",list->to->value);
       list=list->next; 

      }
      fprintf(stdout, "\n");
     }
     system("pause");
    }
  • 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-13T23:38:40+00:00Added an answer on May 13, 2026 at 11:38 pm

    In your code, if you match and hence try to remove the first edge of the list then you will end up dereferencing a pointer which you have freed.

    list=list->next should be V->list=list->next, otherwise you are actually only updating your local list (list) rather than the input’s list (V->list).

    The 0xfeeefeee indicates that you are reading deleted memory on the heap, i.e. that you are dereferencing a pointer on which you have earlier called free. This only happens in debug mode, it’s intend to help you catch this kind of problem! See this wikipedia entry for more information on this magic number (and others).

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

Sidebar

Related Questions

I have this programming assignment that converts between meters and feet, and between kilograms
I'm working on a programming assignment, to make a function template that can handle
For a programming assignment, we are given a template class with two members declared
I am working on a SML programming assingment for class and stuck on a
I'm working on a C programming assignment, I need to simulate the operation of
For my second programming assignment in my Java class, we have to create a
For a programming assignment, we have the following requirements: It needs to be a
I'm working on my first programming assignment for Java and I had another question.
So I finished my first C++ programming assignment and received my grade. But according
I'm rushing against the clock for a programming assignment in which I have to

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.