|
map string to function I am reading a file and when I read a certain string I want to execute a certain function. This is the code i have but I must be doing something wrong, it doesn't compile. I am using c++ (GCC) 3.4.6 20060404 on a RHEL 4 workstation There are three functions in class Convert "void Convert::writeVerts()", "void Co... 29 Nov 2006 04:02
trying to assignment operator I have been looking around on how to do a simple assgnment operator, this is the best I can come up with for assigning a simple structure. coord& operator =(const coord& c): x(c.x), y(c.y){return *this;} Thanks. ... 22 Nov 2006 01:21
debugging a c++ program Hi, I am trying to learn c++ with a little project (using SUSE Linux 10.1 with g++) and made some good progress so far occasionally with the help of GDB as debugger. I have a Makefile with the command g++ and the options line CFLAGS = -g -I $(BASEDIR)/utils -Wall -nostartfiles and I invoke the debugger ... 14 Nov 2006 02:33
Not quite an out by 1 error, but it's out by something <posted & mailed> Hi, I'm using a Berger table to generate a league fixtures list for the English Premier League (though it can equally be for any sort of league). The code below compiles and runs quite happily but there is a problem - one team is always missing and it's not always the same team either! T... 30 Oct 2006 19:27
Good windows C compiler linker I know a simmilar discussion about compilers in general was on this board a while back, but it did not provide info i am looking for. Basically what i want to know is what is a good C99 compiler and what is a good linker to go along with it? I would like to be able to easily integrate C and ASM routines, to do so... 22 Oct 2006 13:38
Postfix to infix Hi. I am trying to write a program that would convert postfix expressions to infix e.g ab* into (a*b) however I am having a problem identifying and printing errors such as illegal characters. If anyone can help I'd be greatful.This is my code so far: #include<string> #include<iostream> #include "stackVector.h" ... 16 Oct 2006 01:49
string conversion (char[50] -> CString) Hello! Would you help me convert string from char[50] to MFC class CString in VC.NET, VC2005. Sample code is: char a[50]; fgets( a, 50, FILE); CString b = new CString; b = (CString)a; I've tried several ways but useless... For now I solved this problem with conversion by single character, i.e. a loop ... 16 Oct 2006 02:20
debugging with std::cout, how to disable it ? I am using this kind of thing to debug,but it does not work if there is << #include <iostream> #define DEBUG_ON true // or #define DEBUG_ON false #ifdef DEBUG #define _debug(expr) std::cout << expr #else #define _debug #endif It works OK until you want to use concatenation "<<" _debug("this " << " an... 8 Oct 2006 17:06
usual errors of fopen I have a code which inside of a loop opens text files for append, but it does not allways succeed, the fopen returns NULL on a 2 and up iterations of loop1, usually what can cause the failur of fopen? My code schimatic is as such: while1{ while2{ if(some condition){ open fiile for app... 8 Oct 2006 14:29
Linked List Data type What up? I am having an issue with an assignment and wanted to know if anyone could push me in the right direction I have to create a singly linked list class that uses a book class as its data. I have gotten the LinkedList class to compile and work using int as its data type but when I add the Book Class it fails... 2 Oct 2006 00:03 |