Simple Tree Syntax Error


I'm creating a real simple tree. No sorting and every node can have infinite children. // TreeNode.h #ifndef TREENODE_H #define TREENODE_H #include #include using namespace std; // forward declare the tree class template< class NODE_TYPE > class Tree; ...
Posted On: Monday 26th of November 2012 12:15:21 AM Total Views:  160
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




simple string question...

Hi all, I wrote a function which has a parameter of "string". When I send the string, can I do like the below void Show::caller(void) { string str = "This object's address is "
VIEWS ON THIS POST

131

Posted on:

Wednesday 7th November 2012
View Replies!

A simple question on multithreading

Hi all, I'm having a fun with multi threading programming. My target machine has 8 Intel Xeon CPUs. Working environment is Linux based and using g+ +. Boost library is being used for my fun. My question is is there any possible way to bind a thread to a specific CPU among 8 CPUs If it is possible would you please let me know where I have to start digging +) Cheers, Alex
VIEWS ON THIS POST

172

Posted on:

Wednesday 7th November 2012
View Replies!

simple? sequence issue

can anyone tell how to convince the compiler to accept the third line in the example below I need this parameter sequence because I want to define a default argument for T , e.g.: template struct Y2{}; template struct X {}; template struct Y1{}; template struct Y2{};
VIEWS ON THIS POST

139

Posted on:

Wednesday 7th November 2012
View Replies!

simple question abt printf

here is the program i am trying to run #include #include main() { int i; i=1; printf("%f\n",i); getchar(); } this prints the value as 0.0000 so how the printf works type casting resolves the issue
VIEWS ON THIS POST

261

Posted on:

Wednesday 7th November 2012
View Replies!

Newby - very simple program that don't work

> Sorry, Windows programming is off-topic in this group, try a win32 > programming group instead. > Ok, I didn't know. Thank you. > > -- > Erik Wikstrm Stefano
VIEWS ON THIS POST

157

Posted on:

Wednesday 7th November 2012
View Replies!

Why the simple code can not compile?

#include "string.h" #include using namespace std; int main() { char buf[1024] = "This is a test."; int len = 1024; bzero(buf, len); cout
VIEWS ON THIS POST

143

Posted on:

Wednesday 7th November 2012
View Replies!

Very simple question

int i = 1; cout
VIEWS ON THIS POST

120

Posted on:

Wednesday 7th November 2012
View Replies!

About simple confusion of array incrementation

hI, I am little confused here See i have int wordlen=10; when int s[] is array s[wordlen-1-1]++; whats the meaning of this can it affects the number which are in array. or it can just shifts from say 2 numbers(which are minused here after each incrementation) what i want to ask is is it shifting 2 numbers or it is minusing 2 numbers in array. means can it affecting the numbers in array. See why I am confused is the real question is here lets take wordlen=20 ok and if we minusing -1-1 means -2 each time then the wordlen will be 18 is it means wordlens value will be changes to 18 or the value of array will be changes to 18 because in next iteration (lets take more than one iteration for s[wordlen-1-1]++) value of wordlen will be remain same because at the start we declare int wordlen=20; i am quite confused but i think some you understand in SHORT MY QUESTION IS is incrementation affecting the value of wordlen or it can affect the value in array means not wordlen particularly PLease give me some explanation and make the way clear
VIEWS ON THIS POST

122

Posted on:

Wednesday 7th November 2012
View Replies!

A simple issue when using the iterator of an vector

I am trying to use the iterator of an vector to read all of its element. The code segment is just like below : cout
VIEWS ON THIS POST

126

Posted on:

Wednesday 7th November 2012
View Replies!

Very simple program. Please critique

This is the second program (not counting World) that I have ever written in C++. However, I'm trying to learn the language while picking up as few bad habits as possible, so please be nit-picky! /** * Exercise #2.1 * * Create a program that takes one argument and prints the corresponding * term from the Fibonnaci series. Bonus: implement caching for function * returns. It also accepts a -test flag which prints a list of fibonnaci * numbers. */ #include #include using namespace std; /** * Defines a whole number type, an integer that is non-negative. This can * be arbitrarily large: the number of bytes allocated per each number * determines how why the numbers we calculate can be before it rolls * over. */ typedef unsigned long WholeNumber; /** * Lookup cache for return values to the fibonacci() function. */ map fibonnaci_cache; /** * Recursively calculates a term of the Fibonnaci series. */ WholeNumber fibonnaci(WholeNumber term) { if (term
VIEWS ON THIS POST

116

Posted on:

Wednesday 7th November 2012
View Replies!

simple compile of a program

Borland c++ builder 6.0 i just want go create a program that has a cpp file and a h file in it. there is some much junk to choose from i tried applicattion, and cpp file. it dumps a bunch of crap in the files, does anybody nknow of a simple way to compile a very simple program, this is for a class i am taking. there is no gui interface etc involved.
VIEWS ON THIS POST

161

Posted on:

Wednesday 7th November 2012
View Replies!

A begginer simple problem !!!

Dear Friends: I started learning c/c++ 2 weeks ago and so know a little about c++ !!! now the problem is that, I found an excercise that I couldn't solve it in no way !!! The problem is that: make this shape with 2 or 3 "for" Repetition Statement. (It means that it is possible even if with 2 !): ********** ******** ****** **** ** **** ****** **** ** **** ****** ******** ********** I programmed one, but it isn't what I want ! but it's this: // Making a strange shape !!! // Programmed By: Mohammad Dashti #include using namespace std; int main() { for (int i = 0 ; i
VIEWS ON THIS POST

171

Posted on:

Wednesday 7th November 2012
View Replies!

simple prob passing a reference of arrays to a func.

void DoThang (char (&cMovesDone)[9]) { for(int i = 0; i<9; i++) cMovesDone[i] = 'k'; } int main() { char c; DoThang (c); cout<
VIEWS ON THIS POST

126

Posted on:

Saturday 10th November 2012
View Replies!

Very simple question

I have very simple question, look at next expression: int b = 0; int c = 0; int d = b+++++c; This expression make me to ask a few questions: 1) What value of d 2) Does it depend ...
VIEWS ON THIS POST

241

Posted on:

Saturday 10th November 2012
View Replies!

simple question.

what am I doing wrong here. on a 64 bit m/c if I just do g++ t.cpp everything works find. if I do g++ -m32 t.cpp it just breaks. ==================== #include static int mcount = 0; using namespace std; ...
VIEWS ON THIS POST

136

Posted on:

Saturday 10th November 2012
View Replies!

is there a simple solution to this template problem?

Hi , The idea is quite simple: generate a container with random values in it. For that, I decided to create a class that I called RandomContainer that inherits from a container (with default value std::vector). To handle the different ...
VIEWS ON THIS POST

207

Posted on:

Saturday 10th November 2012
View Replies!

Some simple questions

1. 1U means that 1 is an unsigned int and not another unsigned type 2. '\012' and '\xb' values are the same with 012 and 0xb 3. Any numbers appearing like the following: '\546' are considered octals or decimals...
VIEWS ON THIS POST

101

Posted on:

Sunday 11th November 2012
View Replies!

simple question about NR

, all. A smple question appears when I first step into the book "numerical recipes in c++"(second edition). In page 3, the third paragraph below the code"Third, comple the main program file, and also the files flmoon.cpp and avevar.cpp,...".But where ...
VIEWS ON THIS POST

174

Posted on:

Saturday 24th November 2012
View Replies!

Help splitting a simple date string

I have a simple string (i.e. February 27, 2008) that I need to split into three parts. The month, day, and year. Splitting into a string array would work, and I could convert day and years to integers later. I've ...
VIEWS ON THIS POST

59

Posted on:

Sunday 25th November 2012
View Replies!

a simple ques

Is char [5:0] abc different from char abc [5:0] ...
VIEWS ON THIS POST

50

Posted on:

Sunday 25th November 2012
View Replies!