I'm not sure whether this is the right place to ask, but...
Me and a group of partners are developing a search engine; the basic idea is that a C++ module is invoked from a Linux console before starting to process queries: that is the indexing module, and it prepares all the data and data structures necessary to rsolve queries. That's alright: the problem is that we cannot find a way to solve the queries using CGI (the thechnology recommended...
User Profile
Collapse
-
Deleting elements from a STL List conditionally
Hi,
We¡re getting a segmentation fault because we¡re trying to delete elements from a List while traversing it, i.e.:
Code:void Character::deleteProcessed(list<Line> &active,int y){ bool erasedAtTheEnd = false; for (list<Line>::iterator it = active.begin();it != active.end()&&!erasedAtTheEnd;){ if (it->getHighPoint().getY() < (HeightFloat/Height)*(y+1)){
-
SVG, XML and W3C
Greetings,
We are making a rendering program. It receives an XML document which specifies how to do so, following the SVG format. The problem is: We need to underrstand the metrics used in that document so as to interpret the drawing commands correctly. Which leads us to reading the SVG specification in w3c.org, which leads us to conclude that their explanations suck.
Do you know about a site which gives a more concrete explanation,... -
Code:class Account{ float balance; public: Account(float balance=0); float balance(); float withdraw(float withdrawal); void deposit(float depositedAmount); };
Leave a comment:
-
Memory control in C++
Does anyboy know if there is a way, in C++, to know how much free space left is there in the heap? (During runtime) -
To begin with, you should define a struct with the fields you need (year, winner, score, etc. with the typed you think appropiate). Then, define a vector<structTy pe> and push_back the records received in input 1. When you need to search, to make it simple, ask for an iterator for the vector and search sequentially comparing the corresponding field.
This site is great:
www.cppreferenc e.com...Leave a comment:
-
dariophoenix replied to Transferring a .JPG image file through serial port to another PC using c/c++in CI'd say you need to use sockets. If you are working in Windows, as it appears, you should investigate about the <winsock.h> and <winsock2.h> libraries.Leave a comment:
-
1 - puts is an ANSI C function defined in the <stdio.h> header
2 - cout is not a function: it's a stream, associated to a file. When you do something like:
cout << "Hello" << endl;
You are using operator << (operator 'send to', which is a function, but written in C++, so unlike puts, it's Object-Oriented) : you are sending the string "Hello" to the stream cout, which...Leave a comment:
-
XML parser
Hi,
I'm working with Visual Studio C++ in Windows XP and I need to parse XML documents (following a given DTD). Which parser do you recommend? -
-
If you mean you have to implement the binary tree data structure using pointers between links/nodes, as in the linked list implementations , check this out:
http://www.cee.hw.ac.u k/~rjp/Coursewww/Cwww/tree.htmlLeave a comment:
-
I googled 'Trees in C' and found this:
http://www.cee.hw.ac.u k/~rjp/Coursewww/Cwww/tree.html
As for graphs, here's a headstart:
http://www2.toki.or.id/book/AlgDesignManual/BOOK/BOOK3/NODE132.HTMLeave a comment:
-
Destroying files in C
Hi,
I am working in Windows XP and I need to destroy a file in a C program (not just erase its contents). The file was opened this way:
Code:FILE* pBinFile = fopen(nameBinFile,"w+b");
Code:remove(nameBinFile); fclose(pBinFile);
-
Well, I figured it out myself: Even if you close a socket correctly, it takes a maximum of 60 seconds for it to be freed: I ran the first time OK; then I waited a minute, ran again and had no problems. So that's it, I hope this helps someone.Leave a comment:
-
Just access the structs' strings and compare those:
if (list[index].name > list[index+1].name) ...Leave a comment:
-
I discovered that changing the port number and recompiling allows for another succesful run (only once, like before). Therefore, it seems to me that ports are not freed after the program finishes. How can I do that?Leave a comment:
-
Linux Sockets and POSIX threads example
Hi,
I am trying to encapsulate Linux sockets and POSIX threads in C++ classes (I work in Knoppix, using KDevelop). Since sockets and threads are new to me, I searched for example code and found the following:
Code:#include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <netdb.h> #include <signal.h> #include
-
font rendering from scratch
we need to do a font rendering from stcratch (without using any non-standard library) in c++. Do you know about any site with information on algorithms and techniques necessary? -
Here's a headstart:
Code://linkedlist.h #ifndef LINKED_LIST_H #define LINKED_LIST_H template <class Element> class LinkedList{ struct Link{ Element* data; Link* next; Link(Element* dat, Link* nxt): data(dat), next(nxt) {} } *head, *cur; public: LinkedList() : head(0), cur(0) {} ~LinkedList();
Leave a comment:
No activity results to display
Show More
Leave a comment: