you did all that in 3mins? i thought there was just like 1-2 lines wrong with mine....-_-
Type: Posts; User: chullen
you did all that in 3mins? i thought there was just like 1-2 lines wrong with mine....-_-
i also drew diagrams for the 1st function in the insertinorder function to follow it line to line, i really dont see where the error is am i just stupid?
im sure the main is correct(or is it?) but whats wrong with the insertinorder function?
the 2nd if function(the if(list==NULL) is correct)
that leaves the 1st if function incorrect, am i...
let me show you what i have altered already
void IPlist::insertInOrder(string address)
// precondition : list is ordered and address is not in list
//...
i think thats a doubly linked list, im just using a normal list
list->info(IPaddress in this case) and list->link
could you show me how to fix the loop?
if the list is empty i just add it to list
1.i create a new node so as to insert the new data into the list?
2.how to make it stop looping after its inserted? im getin confused
void IPlist::insertInOrder(string address)
// precondition : list is ordered and address is not in list
// postcondition : list is ordered and contains address
...
could anyone help me to fix my problem?
how to insert data with the insertinorder if the list is empty?
this is my current code
#include <iostream>
#include <cstdlib>
using namespace std;
oops lol
it works fine now thx a lot for you help Salem~!
node *IPlist::find (string address) const
// precondition : none
// postcondition : returns a pointer to node containing address or
// ...
135 C:\Documents and Settings\IPlist.cpp could not convert `((std::string*)current)->std::basic_string<_CharT, _Traits, _Alloc>::operator= [with _CharT = char, _Traits = std::char_traits<char>,...
lol.....all the errors just disappered except for the
133 C:\Documents and Settings\IPlist.cpp no match for 'operator==' in 'current == address'
i just added a "IPlist::" to what was declared in the header file? did i do it wrong?
ok heres the header file
--------------------------------------------------------------------------------------------------
#ifndef IPLIST
#define IPLIST
#include <iostream>
#include...
for some reason when i try to implement this function it says my list is not declared???
node *find (string address) const;
// precondition : none
// postcondition...