- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 7
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Almost Uni Student.
Hello. I am trying to find out how to write a function to replace a string in a text file. So far i got this: find -> is a word i am looking for replace, rep -> new word, f1 -> my file. And i'm stuck with that piece of … |
|
I need to write a program to enter 3 names then display the name is aphabetical order. Example Jessie, sam, and chris. the program should display: chris Jessie sam Please help |
|
I am trying to use FMOD library in a console application Visual c++ project.... But I can't really get it to work I will tell u exactly what i did... First, I added the following files to the project folder: [B]fmod.h , fmod.dll, fmod_errors.h , fmoddyn.h , fmodvc.lib , wincompat.h … |
|
[CODE=C++]void List::remove_last() { if(first == NULL) { first -> data = ' '; } else { Node *newnode; newnode = new Node; newnode = NULL; newnode -> data = last -> back -> data; last = newnode; } }[/CODE] am I doing something wrong? I'm trying to remove the end … |
|
Hey guys, Here's my story: I had a HDD: Data, ~300GB I created a partition for another OS I'm done with the OS, remove the partition Now, it shows up as unallocated, and I can't find a way to merge it back to the drive it belongs to! A screenshot … |
|
do you know where to find GL/glut.h code? i only found gl.h, glaux.h and glut.h in some links. can you help me? |
|
Hey guys, I know the title isn't possible, but I'd like to here how you'd do it then. Suppose we have this code: [code=cpp] Class Foo {public: int x; }; //somewhere in the code.. int main() Foo one, two; one.x = 10; two.x = 20; Foo *a = &one; Foo … |
|
Hey guys, I have this code snippet: [code=cpp] template <typename ElementType, typename CompareClass> struct Delegate { virtual bool geef(const ElementType &element){ pair <set<ElementType, CompareClass>::iterator, bool> ret; //this is line 196 ret = elements.insert(element); //197 return (ret.second); //198 } virtual void output() = 0; set<ElementType, CompareClass> elements; }; struct ArtiestenPrinter : … |
|
can someone please explain to me how read write work in sock programming. my assignment is to run a server and client. the client ask the server "who are you?" and the server replies with the servers name and date and time. i cannot post my whole code here as … |
|
Hey guys, I'm trying to create an MSCache (2 times MD4) cracker. I took the RFC thingy and implemented it in a cracker which is.. fast, but not as fast as I'd like it to be. So I searched a bit and stumbled on MDCrack, which claims it can do … |
|
Hello everyone! I am trying to use polymorphism to have a little physics simulator that draws objects to the screen. Each object has properties like mass, friction, position, velocity, acceleration and such similar things, as well as a pointer to a SHAPE object which describes the shape of the object. … |
|
Hey guys, Can I tell istream to ignore ALL the characters until the delimiter char? It can be done with a loop but it's kinda weird I can't tell istream "discard until this char" imho, so maybe there's an hidden option somewhere. Thanks in advance! |
|
Hi, I have another question. This one is about header files. I have a header for a player and the opponent of my battleship game. They way I have it set up, the opponent needs a player object to make a move, and vise versa. This is what i have. … |
|
after i've got this error: pure virtual method called terminate called without an active exception Abort (core dumped) i searched and found that it is probably because i'm calling to a pure virtual function from a constructor. well, yes, i'm doing that, but - - what is wrong with that? … |
|
Hey guys, So I have compiled my first home-written static library (named PixGUI) that happens to call OpenGL functions. However, I noticed that when compiling (using MinGWs GCC with Code::Blocks project set to "static library") it doesn't matter whether I supply the linker with libopengl32.a or not, it simply compiles … |
|
Hey guys, Below code isn't working as I expect it to do. I expect it to read all params when 6 are given, buuuuuuuuuuuut it only reads one, the rest remains zero. It does enter the case, but the stringstream buf seems empty. What am I doing wrong? [code=cpp] #include … |
|
Hey guys, What am I doing wrong here? sss.hpp [code=cpp] #include <fstream> #include <string> #include <map> namespace sss { using namespace std; class node { public: multimap<string, string> values; multimap<string, node> children; string &value(const string name, size_t index = 0); node &child(const string name, size_t index = 0); private: template … |
|
Hey guys, How would I partially specilize a template in a manner as below? Is that even possible? I have these two functions: [code=cpp] bool node::read(const char *filename) { ifstream f(filename); if (!f.good()) return false; bool success = read(f); f.close(); return success; } bool node::write(const char *filename) { ofstream f(filename); … |
|
Hey guys, I have a class with a friend function and a member function with the same name. Calling the friend function from the member function gives me an error: it looks for <classname>::<function> while the friend function is of course simply <function>. In this case, MinGW GCC says: [code] … |
|
Hey guys, With this defintion: sss.hpp [code=cpp] #include <fstream> #include <string> #include <map> namespace sss { using namespace std; class node { public: multimap<string, string> values; multimap<string, node> children; string &value(const string name, int index = 0); node &child(const string name, int index = 0); //... }; typedef pair<string, string> … |
|
I stumbled upon another what I think is initializer, like int and char, named [B]HANDLE.[/B] It's also used when creating an application, I've browsed the net and found that it is a sort of pointer to an object that can change without me knowing it... eh... It wasn't really that … |
|
Hi, this is my first post here. The fact is i'm not a programmer and i need help. I have a software that i need to solve a vehicle routing problem for my thesis. But i only got the source code for it, one header file and 6 cpp files. … |
|
Hey guys, I got this code, and I can't get it to compile, no clue what I'm doing wrong. [code=cpp]#include <iostream> #include <vector> #include <iterator> using namespace std; template <class T> void kill_dupes(vector<T> &x){ vector<T> y; for(vector<T>::iterator it = x.begin(); it != x.end(); it++){ if(find(x.begin(), x.end(), *it) == x.end()){ y.push_back(*it); … |
|
Just a curious Question. What do you prefer, QT or wxWidgets? How do compare the two in terms of: 1. Nativity 2. Easiness to learn 3. Documentation 4. Weight (The size in MB) 5. Licencing 6. Any other factor(AOF) Thanks all! |
|
Hi guys, What am I doing wrong here? Program dies on me @ merge(). :( [code=cpp]#include <iostream> #include <vector> using namespace std; int main() { int afrom[4] = {0,0,1,2}; int ato[4] = {1,2,3,4}; vector<int> from(&afrom[0], &afrom[4]); vector<int> to(&ato[0], &ato[4]); vector<int> length; vector<int> all_nodes; sort(from.begin(), from.end()); sort(to.begin(), to.end()); merge(from.begin(), from.end(), to.begin(), … |
|
As part of an assignment I am creating a class to handle rationals with numerators and denominators, overloading the operators for cin and cout, as well as +-*/. So these are the functions for those operators, now where exactly should I include these in my class? [code] Rational addition(Rational a, … |
|
Bah, once again I am beat by the computer logic... Anyone have an answer as to why it gives me an error: "Expected a constant expression at msg" Here's the code, [CODE] const int INFOWND_SIZE = 4; int msg_length[] = "Message"; double calc_amount = (double)msg_length/(double)INFOWND_SIZE; int msg_amount = (int)ceil(calc_amount); char … |
|
Hey, im trying to delete an element of an array of pointers of a class, how can i delete just a single element? my code is basically this... n =8; ClassName *newName; newName = new ClassName[n]; how would i delete for example, element 3, while being in that element... if … |
|
i am new to c++ and wonder about how i create a file for example string flight; cin>>flight; flight=flight+".txt"; ofstream myfile; myfile.open(flight); instead of having a fixed name like myfile.open("file.txt") but it doesnt work , are there elegant solutions to this problem i have. all the help is appreciated. |