General C++ Programming - July 2008 (Page 3)

by lipune
c++
 
Hi to all , so can u tell this answer plz,,,,,,what is the use and where to use of overloading new and delete operator in c++. 2-if what is the return type of...
[1 reply] : Hi, the overriding is for allocating memory in your own way, say y... (by arsen)
using a template class with arrays
 
I'm currently working on an AIM client as a summer project, and am writing the OSCAR protocol code. I can't come up with a good way to represent TLVs (type, ...
[1 reply] : I don't exactly understand what you want to do, however it sounds like... (by exception)
BIT Pattern Search in Binary file
 
I have loaded a binary file into memory (using ios::binary). I need to search for 10101 (or 0x15), which I did by searching each value returned by file.get(). W...
[1 reply] : I don't know of any method readily provided for this kind of thing. Ho... (by exception)
Using C++ to get HTML
 
Is there a way for me to use C++ to open page 1, page 2, page 3 of a website that's named like test.com/1.html, test.com/2.html, etc. and take line X of each pa...
[1 reply] : use curl or smth to get the page; than just parse it like: parse... (by amrok)
Nested if statements in C++
 
I'm writing a program and having a little trouble with the if statements in it... is this legal? if(Board ==1){ if(Board ==1) return 1; if(Board ==...
[6 replies] Last: This difference is x==1 and x==2 compare to see if x is equal to the n... (by cookt)
pointer crash
 
Can some one please explain me, why the program is crashing when delete intptr and how to avoid it int aVar=10; int *intptr= new int; // a pointe...
[5 replies] Last: line 3 is technically correct, it will just output the address of the ... (by cookt)
by oktet
legal or illegal
 
Is this legal according to C++ or illegal? Notice the location of int main, and the arrays specifically. const int BOOKS = 21; // 8 Parallel arrays, delcl...
[6 replies] Last: Any variables that are declared outside of main are global, in that ot... (by cookt)
vector of strings
 
hi what is the best way of defining a vector of strings inwhich elements starts from "M00000" and ends up at "M01269". Thanks hash mobtadi
[3 replies] Last: So basically you plan on doing a string comparison search to match an ... (by helios)
by kotoro
question about destructors and user-defined structs
 
I just wanted to check whether the following destructors are necessary at all or whether they are implicitly defined. Would the compiler define an implicit dest...
[9 replies] Last: Now there is no delete next ; in the destructor so no confusion. Yo... (by anilpanicker)
by asjt3
Weird pointer dereferencing phenomenon
 
Hey guys, I've got a decode function which decodes from a buffer. It reads the buffer to a var, _int64 myValue. Since the buffer stores a pointed double valu...
[2 replies] Last: For some reason, it only prints correctly when in tandem with myval, a... (by asjt3)
object initialization. copy constructor
 
Hello. I'm having some troubles. Please examine the following code: #include <iostream> using namespace std; class myClass { public: myClass() { cout...
[2 replies] Last: Here are the answers to you questions; At Line 26 you call myFuncti... (by anilpanicker)
template function. Check the code.
 
Please check the following code and explain what is meant by passing the address of the array . Shall we send the name of the array preceeded by & or * or just...
[1 reply] : passing const T& array argument to amax function means that it tak... (by arsen)
FIXING ERROR IN MAIN FUNCTION...Date validator program..
 
hi..im trying to make Date validator.. can you help me to fix error...i cant run this program..because of some errors... says undefined result,false,bool, true...
[1 reply] : No error in code, it is being compiled and works fine. Only a little b... (by arsen)
I'm really not happy with the way it's turning out
 
I've been working on this program for a good while now. I have 7 files, the main.cpp, three headers and three cpp files all included into the main. I've crea...
[2 replies] Last: As you can see, it's getting rather lengthy.. more so than I think it ... (by Aakanaar)
[SOLVED] multiple if-statements for switch
 
Hi all, I'm new here. My intent is to get this function to return an integer which I can use in a subsequent switch statement. Somehow, it does not work, and I ...
[5 replies] Last: My desk has a nice imprint of my head now. Edit: Two now. (by toshiro)
Class function returning another class type
 
Hi everyone. I've created two classes, one to deal with vectors and the other to deal with tensors. I want to have a function in the vector class returning a...
[1 reply] : You need to prototype the class before you define it: template <ty... (by Duthomhas)
I Need to implement a search function in my program
 
Hello everyone, as you can see this is my first post here.Here is what I want to do, When I type add the program adds a new object in the form of word or whatev...
[2 replies] Last: Thank you very much! (by pikachumanson)
by bulbus
how to concatenate const char and const char*
 
i am tryiny to concatenate these two strings catch (exception& e) { sError_ = "Standard Exception: " + e.what(); } and it throws the follwing error e...
[2 replies] Last: You can't assign to char arrays like that. I don't know what type o... (by Duthomhas)
by oktet
Command: Function accept parameters - NOW!
 
// How does one modifiy the lookUpBook function to accept a book title as an // incoming parameter? // I know it is 4:45 AM, // but C++ is fun, and hard at ...
[2 replies] Last: Thank you Nandor, I have been up all night C++'ing, and I think its ti... (by oktet)
by oktet
The right way to declare an array globally
 
Okay I have been doing a some reading on arrays from both cplusplus.com, and one of Tony Gaddis C++ books. I thought you could just declare one type of array;...
[4 replies] Last: yea.. you declare an array the same way, whether it's global or local.... (by Aakanaar)
July 2008 Pages: 12345... 10
  Archived months: [jun2008] [aug2008]

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