Tbh, I have always known pointers from when I learned them, but via school we have always used Java, so I haven't worked that much with pointers. I used an array to fix the code, but I was not sure...
Type: Posts; User: vgame64
Tbh, I have always known pointers from when I learned them, but via school we have always used Java, so I haven't worked that much with pointers. I used an array to fix the code, but I was not sure...
OK, I thought that for a second...i just sure as heck hope thats what my teacher is trying to show. It's simply two lines of retarded code...at least to make a mistake like that. So...I was just...
I have a C homework to do (I am a C++ guy) and the question asks us how to fix the following code the crashes:
int *a = 0;
*a = 5;
Fix it using dynamic memory management or static variables.
...
I solved it and corrected the code...so nvm. Thanks!
Hi, I am stumped as to why the following code isn't working properly:
(I will organize the code into functions and what not after...it was like that before, but i changed it many times to make it...
Thanks!
I believe it assumes that elsewhere NodePtr and Head, etc are defined.
Oh, so you are saying since *cur is pointing to nothing, it cant work?
And this is the exact question if I asked it wrong:
The following function is supposed to return the length of a linked list. What are the logical errors in
this function?
int length(NodePtr...
whatever random value the os has stored in that memory space for i at that time. Other compiler would just give an error.
to the node counter?
..nvm, let me think some more before answering.
Hi, their is part of a homework problem which I seem to be stuck on. It asks what are the logic errors in a program if the function defined is supposed to return the legnth of a linked list.
The...
Ah yep, makes sense. Thanks for the assistance.
Hey, I am just wondering if a class definition can include two constructors, such as the following:
Year(int days = 365, int weeks = 52, int months = 12);
Year();
Thanks (my intuition says yes...
AHH I figured it out!!!
Thanks so much for your help....I am indebted to you for life!
^_^
:D
:D
:D
thanks!