General C++ Programming - January 2011

by Liang
How to free memory in this operator overloading definition?
 
This is the declaration of a class called String. // string1.h -- fixed and augmented string class definition #include <iostream> using std::ostream; usi...
[3 replies] Last: Yes, it sets ps to null. It isn't necessary to do so in this case, bu... (by kbw)
last queue question
 
i feel bad about bugging everyone with my stupid queue assignment but i have one last question. i have to show the entire queue list and i don't know how to get...
[8 replies] Last: Crap, you are right. I thought it was a true adapter. (by PanGalactic)
hang problems
 
My program is now facing a strange problem. When I want to return a value from this function maxInfoItemInIPSoln(estimate, item, strata , testLength, j, sele...
[1 reply] : Is that really one function? You have to learn to split your code into... (by hamsterman)
Select() Bad file descriptor
 
Hello everyone, I am trying to use a library found on the Internet for communication with network sockets, implementing a client-server communication. In the ...
[5 replies] Last: Solved! I didn't know that when I exit from the context is automatical... (by VelezSarsfield)
Does using prepared statements with mysql C API protect against sql injection?
 
like how prepared statements protect against sql injection in sqlite?
[no replies]
Problem with file input
 
Let me set this up. I'm working on a Battleship game program. I started it a long time ago and have gone through many iterations of the program (making it more ...
[6 replies] Last: messing about with text files is quite a pain. you could make life ea... (by bigearsbilly)
Array inside a class deallocation
 
Hi, I have a class like this: class compConfigList { public: compConfigList *prevList; compConfig *CompConfig ; compConfigList *nextList; ...
[2 replies] Last: Thanks. (by aryajur)
queue getter function
 
alright so basically i'm doing an assignment where i have to have people enter their name and it puts it in a queue. i also have to be able to display the queue...
[8 replies] Last: Just destroy the container. Read the top, remove it from the queue, [... (by ne555)
stupid errors...
 
ok so i'm trying to run my program and i keep getting 3 errors. the first: public: if(cContinue != '0') the error says "expecting unqualified-id before 'i...
[4 replies] Last: im coming into the 3rd quarter trying to catch up. also as i stated th... (by motowalker)
Why would a program crash like this?
 
I've got a program that worked fine one day, then the next day it crashed when trying to access a function. I made a new function that was exactly the same and ...
[8 replies] Last: Well then you should show us the code that's calling the function in q... (by Disch)
by ToniAz
Debug Vs. Release
 
Hello Everyone! I've finally come to know, and shall I add accidentally, the difference between Debug build and Release Build when I posted something in the ...
[10 replies] Last: C is 40 years old. There's not a whole lot here that's new. (by kbw)
CryptoPP Signing fails
 
Hello, after trying for long enough to work with openSSL, I have decided to not use it, Instead I'm going to use CryptoPP for what I need. Unfortunately, it...
[2 replies] Last: I tried a few other examples, and none of them seem to work, same erro... (by Phantom139)
Questions about auto_ptr
 
Hello, I have been coding a game client for probably a few months now and I just recently decided to switch to auto_ptr's to save myself any errors in the futur...
[1 reply] : Ownership of objects pointed to by auto_ptr is transferable, but not s... (by simeonz)
by DOSIX
timer problems
 
I'm looking to create a timer that counts down from a random amount of time. Basically the timer should be set to a random amount of time in a certain time fr...
[4 replies] Last: I'll try to run that. I just have a little bit of difficulty understan... (by DOSIX)
i am trying to make a calculator, I need some hints and guidance
 
Hi guys, i am am a beginner i am trying to write a calculator that gives op like >>2+6 >>>>ANS=8 in general num1 operator num2 should give the answer ...
[7 replies] Last: I recently shamed myself with my ignorance on the application of recur... (by simeonz)
Constructor call inside Constructor.
 
In the below code I am trying to call a constructor of another Class in MyClass constructor. Its working fine. But my question is this a right way to do it or ...
[3 replies] Last: OR: class MyClass { AnotherClass* var; public: MyClass... (by Kyon)
How can I calculate L1 data and L2 cache sizes?
 
Hi I want to write a small application to estimate the size of my L1 data and L2 caches. I don't want to use OS specific calls, such as Windows' GetLogica...
[2 replies] Last: Thanks for the response. That did occur to me, swapping, paging etc... (by steve lorimer)
virtual tables
 
Can i access the virtual tables explicitly ??? According to my understanding the virtual table is an array of pointer to functions. So can i like get the base a...
[7 replies] Last: It is still unclear. The "address" of a virtual function by itself ... (by jsmith)
incomplete type
 
hi, i've got class "zespolona" and class "numer" in separated folders. their definitions are: --------------------------------------- #ifndef _NUMER_H #defi...
[2 replies] Last: thank you. I'll read this. (by pgregor)
by ogward
send to function
 
Hi there! I have a function in club.cpp that looks like this. void Club::addMember(string name, string birthDate) { if(this->nrOfMembers==this->capaci...
[2 replies] Last: Thanks a lot dude, the thing that i forgot is the call-by-reference. ... (by ogward)
January 2011 Pages: 123... 24
  Archived months: [dec2010] [feb2011]

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