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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:03:06+00:00 2026-05-28T02:03:06+00:00

When I change the last parameter in the function header from char Findthis[64] to

  • 0

When I change the last parameter in the function header from char Findthis[64] to char * Findthis when debugging the Testthis=&*Look_in; assignment breaks. Look_in has a memory address and member values but Testthis is not being assigned that pointer location. Why is this happening?

struct Node * ProbableMatch(struct Node * Look_in, int MaxNodes,
char Findthis[64])
{
    char Findit[64];
    strcpy_s(Findit,64,Findthis);
    struct Node * CurrentHighProb;
    CurrentHighProb=new(Node);
    struct Node * Testthis;
    Testthis=new(Node);
    Testthis=&*Look_in;

    while((Testthis) || (i!=(ccounter-1)))
{ //This Testthis does not cause exception
    string str1;
    string str2;

    n1=sizeof(Testthis->NAME);
    n2=sizeof(Findit);

    n=0;
    while((Testthis->NAME[n]!='\0') && (n<=n1)){
              //While Testthis->NAME here causes the exception
         if(Testthis->NAME[n]=='-'){Testthis->NAME[n]=' ';} 
        n++;
    }//end of while

//_DIFFERENT PART OF PROGRAM____

 std::string Findme;
 cout<<"Enter varible to find. Type quit to quit, case sensative."<<endl;
 cin>>Findme;
 char * writable = new char[Findme.size()+1];
 std::copy(Findme.begin(),Findme.end(),writable);
 writable[Findme.size()] = '\0';

 if((Findme.compare("quit")!=0) ^ (Findme.compare("Quit")!=0) ^ (Findme.compare("QUIT")!=0)){
    ProbableMatch(head,ccounter,writable);
 }

 delete [] writable;

//_ NODE____

struct Node 
{   public: 
    int VARID,counter,prob;
    char NAME[64];
    char DESCRIPTION[1024];
    struct Node* next;
}node, *pNode=&node;
  • 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-28T02:03:06+00:00Added an answer on May 28, 2026 at 2:03 am

    Ok looks like the std::string to char * conversion was causing leaks.

    Switched to a vector option as suggested here: How to convert a std::string to const char* or char*?

    Problem went away. I’ll have to trace the actual memory later but I find it odd that that string memory was placed right next to the begining of the linked-list.

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

Sidebar

Related Questions

I would like to change the order of names from Last, First to First
I have First/Last/Previous/Next buttons that change the selected child node of a TreeViewItem. Setting
Update: Last night, I decided that this is just too much work to change
Last Thursday we just released a new version of our website. The big change
I installed Mono on my iMac last night and I immidiately had a change
With the following function: =FREQUENCY(C2:C724,D2:D37) The second parameter is the BIN What I don't
I'm trying to call SendMessage with an uint parameter from Java, but I can't
In unmanaged C++ I have a function which I'm trying to call from C#.
I want to change the background-color for the last menu item clicked in the
I've been fighting with Mathematica's Manipulate function for the last few days for a

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.