Are my comments regarding the staement below correct.
node *top_ptr=create_node();
// () has highest precedence so function called first
// then * indirection operator has second highest...
Type: Posts; User: anthonye
Are my comments regarding the staement below correct.
node *top_ptr=create_node();
// () has highest precedence so function called first
// then * indirection operator has second highest...
I know that a pointer must be of the same type or object as the object its pointing to ie int pointer points to int,char pointer points to char and so on, But what exactly does a node pointer point...
// I can see why functions delete_nodes and input_data have pointers as there argumens
// because they are passed the address of top_ptr ok thats fine.
// Now top_ptr is declared as a pointer to...
// This code compiles fine but is there anything I should know also could you please put
// me straight on my comment in the code Thanks all.
[code]
#include<iostream.h>
#include<conio.h>...
Please can you help with my lniked list I've got a node declared and passed to function
append_nodes wihtin main, Then in that function I input the elements for the node and assign the
next...
where would I use linked lists ie ( what type of situation / program) , I know that we don't nessasary need
them in situation where we ask for the amount of say people to be stored up front in this...
please let me know if this is ok as it is my first linked list example
I do not what my code changed as I will deal with that later.
I just want to know is this fine up to this point and after...
PLEASE PLEASE PLEASE try to keep my prog like it is
as this is my first linked list and trying to get used to them.
just solve my questions for now.
thanks guys.
Is this prog fine and if so how would I go about
freeing memory set up for the nodes in a seperate function
also why is it a bad idea to store data in the top node.
#include<iostream.h>...
ok ripper.
for an amount of people then create a linked list
for that amount of people ie if you input 15 I
want a linked list of 15 structures(nodes) and the
for loop to accept the input for...
lets say amount has been passed a value any value now I want to
make a linked list of size amount, How do I go about making the
cin statements enter data into each node for each iteration and
the...
THanks salem but... is that it or is there more to it, oh and why
I know word ailgnment alighns things but why is it just to make things run quicker, ie quicker access to the data members.
thanks for the help.
#include<iostream>
#include<conio>
#include<stdlib>
#define MAX 30
struct node{
int age; // 4 bytes
char name[MAX]; // 30 bytes
Yes ok. but what is namespaceand are all headers writen
without the .h extension ie #include<iostream.h> is now
#include<iostream>.
thanks guys.
what does that mean.
ps I have an old compiler
is everything in my prog perfect apart from being not very practical
#include<iostream.h>
#include<conio.h> // supported by c and c++
int main()
{
How is it possible for me to use new and delete with functions
from c like printf when new and delete are specific to c++.
ps. What are code tags.
Thanks
just getting back to programming and want to check new and delete operators,
are the following code snippet and comments correct, also the storage duration
of the new object is from its creation up...
It's a while since I did linked lists is the following prog fine and if not why not.
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#define MAX 30
sorry I mean area not volume of a triangle.
more info of why it would be a cube hard to put this question in words but here goes.
the volume of a triangle is 1/2 * base * height this is divided by 2
because it would otherwise be a...
I know the volume of a pyramid is 1/3 * base area * height.
but cant remember why a 1/3 can someone please tell me why.
thanks for all the help.
/* ok I now understand single linked lists just have this slight */
/* problem freeing them here */
/* I know when I input 1 for the amount there are two nodes ie top and newnode */
/* so when...