General C++ Programming - April 2010

binary tree question
 
Label a binary tree with keys from the set {8, 21, 11, 16, 12, 1, 9}, so that it is a legal binary search tree.
[3 replies] Last: There is more than one answer to the question. For good marks, OP shou... (by choisum)
return parameter or normal return
 
In c++ it's valid to do this: string what_to_do(const string& day){ if(dayIsWeekend(day)){ return "drink"; }else{ return "wo...
[1 reply] : I'm asking a question as to why you'd want to use string * plan as a... (by Albatross)
array search
 
This function will search the array for allTitles of totalRec elements to see if it contains the given title and if a match is found, then the function should r...
[3 replies] Last: Take a look at this for reasons why it would be better to use sequence... (by kempofighter)
Problems Using an Overloaded stream operator as a friend
 
I'm currently writing a templated queue class and I am running into some issues with overloading the << stream operator. When I go to compile it in gcc, I get t...
[3 replies] Last: Except that with templates, you don't have that option. You must pu... (by jsmith)
Lenth of character Array
 
Hi Experts , I have a char array of strings initialized like :- char *a ={"one,"two","three", ..... } I want to find the number of elements ie strings...
[9 replies] Last: One thing that wasn't mentioned is that the moment you pass the array ... (by kempofighter)
Error in Accelerated c++ 4.1
 
I am new to c++ programming and I started with Accelerated c++ as beginning book as it was recommended in this forum. The book was going ok until I reached ch...
[4 replies] Last: (by agajantorayev)
by Rycul
Reading several lines from file
 
Heya folks, Im trying to create a function that reads a file (preferably line by line) and use that input to fill a 2D array. Imagina having a file filled bu...
[2 replies] Last: I quickly read through that thread, and I suppose that I should use ... (by Rycul)
by danp
freeing memory
 
declared double * *NextMonthValues; as private in my class used in dll I allocated memory via new when I include following code in the destructor: for...
[no replies]
extended hanoi tower
 
dear all I should write a recursive version of extended Hanoi tower. Extended Hanoi tower is similar the normal one. The difference is that here odd rings ar...
[no replies]
Interfacing with sound drivers
 
Hello, I'm generally new to C++ programming and have recently made a basic program which parses a text file in order to play simple melodies using Windows.h def...
[1 reply] : Do you mean using wave output or the system speaker? The system speake... (by helios)
doing away with the server loop
 
for writing server programs, there usually is an infinite loop meant to accept connections and process them and when I want to end the server I would normally h...
[4 replies] Last: Just because you kill with ^C, it doesn't have to be ugly. You could o... (by helios)
Programming Challenges
 
can somebody write the c++ source code of this problem: A sequence of n > 0 integers is called a jolly jumper if the absolute values of the differences betwe...
[9 replies] Last: agajan, you're not going to "learn" programming by having everyone sol... (by packetpirate)
Compare Two Files And Get Total Price
 
Hello guys. I have a question as part of an ongoing project I am working on. The final piece of this project involves comparing two files, one with certain part...
[1 reply] : Can you define what you mean by "compare" ? (by blackcoder41)
class declaration
 
I have predeclared a class like this class PortConnection ; then i declare and define a class class PortWriter {}; this class uses an instance o...
[7 replies] Last: Heh. I've never seen it used like that before. Is that an acronym for... (by imi)
NEED ASSISTANCE W/ PROGRAM!!
 
1. Generate 10000 positive numbers between(0,200) 2. Search the position of the first 100 in the array 3. Count how many 100 in the array 4. Sort The array ...
[7 replies] Last: this is the code that i've written in C++. Im in need of assistance in... (by Neddrick)
by Uni616
Parsing text file works in windows compiler but not linux
 
Hey, I have to read numbers from a text file. Heres an example input: 6 8 1 2 10 1 3 9 2 3 7 2 4 2 3 5 5 4 5 3 4 6 8 5 6 4 The parser I coded work...
[no replies]
Recursion, possible search tree
 
I have a program assignment, just needing a little help in the right direction implementing part of it. I'll give a general brief description of what it does. I...
[3 replies] Last: Dynamically allocated nodes..linked together...its like a linked list ... (by KrishnaV)
Vector member functions
 
I'm wondering something, I really need to be able to access the next to last entry in a vector in real time. I am aware of the vector.back() method, but I need ...
[7 replies] Last: No, stick with it here. If you can put a "visited" flag in your Se... (by Duthomhas)
Multiple Inheritance
 
Hi! Am am currently working on a Phd project where I use C++ and a Finite Elemenet open source project called oofem to conduct my research. I have a problem ...
[4 replies] Last: See "What is the dreaded Diamond?" -> http://www.parashift.com/c++-faq... (by jRaskell)
Need Assistance Please!
 
Hello Everyone! I am currently working on a bitwise operators program. My problem states that I need to prompt the user for two unsigned short integers, and ...
[no replies]
April 2010 Pages: 123... 24
  Archived months: [mar2010] [may2010]

This is an archived page. To post a new message, go to the current page.