Programming Thread

Viewing single post

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

the-pi-guy

I just had an issue like that!

In c# I replaced the variable with a function that acted like a variable. Then it could print a message everytime it was changed and tell me who changed it. Does c++ have similar?
So what the assignment is, is to implement malloc (memory allocation).
But it requires a data structure to keep track of data locations.  

I was using an array that would change length, by getting reassigned basically.  

But apparently assigning the arrays that way has some unusual behaviors.  

I changed all the declarations to utilizing malloc, which feels wrong.  Now it works great.  

It's apparently fine if the data structure uses malloc, but eh I don't like it.