|
|
Up |
|
|
  |
|
|
  |
|
|
  |
|
|
  |
Author: hellohello
Date: Apr 3, 2008 20:34
I am working on a programming project for my c++ class and I get this
weird error that I can get rid of. The method is a private method
that is supposed to copy a linked list to a new linked list and I get
this error: SortedList.cpp:190: error: expected constructor,
destructor, or type conversion before '*' token. The heading of the
function is this and ir errors on the same line:
ListNode *copyList (ListNode *L){}
|
| |
|
2 Comments |
|
  |
Author: André CasteloAndré Castelo
Date: Apr 3, 2008 19:33
Hi
I have a class X and I'm using a list to store X instances. Later in
the project I realized that I needed to search that list for certain
instances and I thought of storing the found objects in a vector.
My problem is - how can I run through list, with a
list::iterator, and use a pointer to point to the selected objects?
I'm thinking of rewriting all instances of list and use list
in order to be compatible with the search function.
|
| |
|
2 Comments |
|
  |
Author: Jim JohnsonJim Johnson
Date: Apr 3, 2008 18:34
does the STL Class vector can hold any user define type?
#include
vector< MyCar> cars( 7 );
above OK?
|
| |
|
7 Comments |
|
  |
Author: Eric KaplanEric Kaplan
Date: Apr 3, 2008 17:21
why calling PostSoapRequest will crash the program?
should I pass string* for start and end?
int post_soap_request(string start, string end)
{
string request = ""
+ start + end;
const char* REQUEST_BODY = request.c_str();
ne_set_request_body_buffer(req, REQUEST_BODY,
strlen(REQUEST_BODY));
// some more code
return 0;
}
HRESULT PostSoapRequest(string start, string end) {
return (post_soap_request(start, end) == 0) ? S_OK : E_FAIL;
}
|
| |
|
4 Comments |
|
  |
Author: Carmen SeiCarmen Sei
Date: Apr 3, 2008 16:48
why the following code not compile
================
#include
using std::cout; // must need for using cout
using std::endl;
#include
using std::string;
int main()
{
string stringa("abc");
string stringb("bbb");
cout << merge (stringa, stringb);
} // end main
string merge ( string a, string b){
string c = a + b;
return c;
}
|
| |
|
3 Comments |
|
  |
Author: qlin88qlin88
Date: Apr 3, 2008 13:48
Hi,
In STL multi-map, the lower_bound, upper_bound,equal_range all
return an iterator. Now ifone wants to iterate from an upper bound
towards a lower bound, what would be the best way to do it?
I tried to interate backwards with an iterator, but the begin()
element was not properly included.
Thanks for your help.
|
| |
|
4 Comments |
|
  |
|
|
  |
Author: ChristopherChristopher
Date: Apr 3, 2008 13:29
I am trying to implement a generic tree class, as I had mentioned in a
previous post. I want it to be STL like, so I went and researched how
to implement an iterator and copied an example from a page online.
template
class GenericTree
{
private:
class Node
{
public:
Node(const T & data) {}
// other methods
};
Node * m_root;
public:
// Other methods
class Iterator : std::iterator
{
public:
|
| Show full article (1.46Kb) |
|
7 Comments |
|
|
|
|
|
|