Aug 15, 2012 at 8:54pm UTC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#include <iostream>
using namespace std;
struct list
{
int data;
list *next;
};
list *node, *tail = NULL, *head = NULL;
void add2list();
void extrem();
int main()
{
add2list();
extrem();
return 0;
}
void add2list()
{
int input;
cout << "Adding values to list :\n" ;
cout << ">>" ;
while (cin >> input)
{
node = new list;
node->data = input;
node->next = NULL;
if (head == NULL)
{
head = node;
tail = node;
}
else
{
tail->next = node;
tail = node;
}
cout << ">>" ;
}
}
void extrem()
{
int x, y;
cin >> x >> y;
}
Why doesn't the implementation of the instructions that in the function extrem???
help me to solve this problema
Last edited on Aug 15, 2012 at 8:55pm UTC
Aug 15, 2012 at 9:24pm UTC
when i run this program it's only execute the add2list function ????
is it clear now or not?
Last edited on Aug 15, 2012 at 9:25pm UTC
Aug 15, 2012 at 9:45pm UTC
@LowestOne
I did like what you said but the problem not solved yet
Aug 15, 2012 at 10:14pm UTC
I think the program does not take any input, only in extrem(), which is called after add2list().