General C++ Programming - August 2011 (Page 6)

Saving Binary Search Tree to a file
 
How would you recommend traversing a binary search tree to save it in a file. The nodes are sorted alphabetically so that an inorder traversal prints them alpha...
[2 replies] Last: The words are read from a file, but not in alphabetical order. I know ... (by rtzoeller)
Pointer to struct, access element
 
Hi all, I have been trying to access an element in a dynamically allocated struct. The problem is that it either will not compile, or return a seg fault when i...
[3 replies] Last: (temp)->frequency++; still crashes the program. However, the code yo... (by rtzoeller)
C++ Retrieve Part of String
 
Hello everyone, Is it possible for a console app to retrieve part of a string according to what the user inputs, for example: The string is: "he llo my n...
[16 replies] Last: Thanks for your help, I then tried this: #include <iostream> #include... (by Muhasaresa)
by dpb167
Using the new operator inside of a method.
 
Hello, I'm working with a program that processes a whole lot of 1024x1024 images that are stored as "ImageReader" objects. I want to write a method that turn...
[2 replies] Last: Thanks! (by dpb167)
by wtf
factorial with bignum class
 
I have the basics down on my integer class. (addition and multiplication, subtraction and division I'm putting on hold until i get everything else right.) t...
[4 replies] Last: thats not it. I commented out the lines 7-8 in your above post and th... (by wtf)
by wtf
Why won't this work?
 
#include <iostream> #include <exception> #include <stdexcept> #include <string> using namespace std; //const int dat = 10; int dat = 10; bool test...
[6 replies] Last: The OS probably has system calls that let you access another process' ... (by helios)
Heap corruption
 
Hi, debug error says: HEAP CORRUPION DETECTED: afer Normal block (...) CRT detected that the application wrote to memory after end of heap buffer. this e...
[4 replies] Last: I mean.... cAffiliate has 3 ctors: cAffiliate(void); cAffiliate(i... (by Krzysztof Kwiecinski)
deleting problem
 
Hi, when i`m trying to delete tmp2, it deletes also tmp, is there any reason why ? template <class T> bool Tree<T>::deleteAndFix(Node<T>* tmp){ if (tmp ...
[3 replies] Last: Thnx Guys :) (by aymanbah)
delete this ? what does it mean ?
 
Hi , Given this code #include <iostream> using namespace std; class A{ public: A(){x=1;} void func2() {delete this;} i...
[7 replies] Last: why would you want to delete this anyway? (by wtf)
mfc edit box auto scroll position
 
Hi I created a edit box that is Cstring to Array. Now it updates by timer. however, When the user presses the ENTER key or new data from array comes in , t...
[no replies]
C++ Character Press Count
 
Hi everyone :D, I am making a console app in Dev C++. I was wondering if it is possible for the application to register the number of times a character is en...
[3 replies] Last: int char_count = {}; char ch; cin.get(ch); if (ch == 'a') { i... (by closed account DSLq5Di1)
General c++ questions on polymorphism & composition
 
After the end of my first c++ course , I have some questions that I'd like to discuss with you guys :) 1.Why would we ever want to upcast (or use upcasting) ? ...
[4 replies] Last: 1) The whole idea of inheritance is that you can write code that uses... (by Disch)
by eth0
Struct Pullthrough
 
Hi there, So I am trying to create a structure in a library that I have. The library is compiled into a 'lib.a' file. I would like a structure to be defined in...
[3 replies] Last: Hi guys, ljs: I tried to include bla.h in bla2.h, but that didn't quit... (by eth0)
How should I insert a char into a set?
 
I'm trying to inset a char into a data set. They way it has to be done is the following. The char is sent from int main to a class and inserted with a functi...
[8 replies] Last: No I didn't write the code, I'm just supposed to fill in the blanks an... (by skatingrocker17)
recursive array counter
 
I don't need help with the assignment, I am happy with it. I am just wondering if there is a way to start at A instead of A (l being the max position) withou...
[4 replies] Last: thank you helios. I often forget simple things (array variable is a p... (by closed account zwA4jE8b)
by aj3423
minGW iostrem GetLastError 1113 (1,2)
 
#include <windows.h> #include <iostream>// GetLastError() will be 0 if these using namespace std;// two lines are removed int main() { GetLastError(); retu...
[23 replies] Last: that is not the "preferred way", it's the only correct way that's th... (by aj3423)
a simple question
 
ok lets say i have this cout << 0; cin.get(); ok lets say i have it in an endless loop so whenever i press enter it will display 1 zero per line right...
[4 replies] Last: This solution handles overflow correctly (though I just realized that ... (by shacktar)
RapidXML First node is null
 
Hey there, I'm busy implementing RapidXML as a resource manager for my game engine. I'm running into a problem that it cannot find the first node within the XML...
[5 replies] Last: Hmm, i don't know how rapidXML works, but maybe you should load inFile... (by bartoli)
C++ Sudoku question
 
Hi guys! I created the sudoku generator, but i don't know a way how to hide the sudoku numbers. Is there a way to hide them? I also wanted to swap a char x w...
[19 replies] Last: Post or send me a PM with the whole Program, I'll have a look at it, s... (by ZED0815)
C++ Encryptor/Decryptor Problem
 
:D Hello again, I am making a console app in Dev C++ where text can be encrypted and the encryption is saved to a single string. The encryptor is a simple su...
[3 replies] Last: Thanks :D (by Muhasaresa)
August 2011 Pages: 1... 45678... 29
  Archived months: [jul2011] [sep2011]

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