General C++ Programming - October 2009 (Page 5)

Abstract classes (?branching)
 
Hello. I was fooling around with abstract classes (Possibly in a way you're not supposed to use them). The following code asks questions about food, and has ...
[no replies]
by NGen
Template Inheritence
 
template < typename T > class BString { protected: std::allocator < T > _Buf; Uint32 Length; public: BString operator += ( LPSTR Text ...
[2 replies] Last: If it means that I can still overload the assignment operator and crea... (by NGen)
dynamic memory allocation of class objects
 
I am not able to add data on run time (dynamic allocation of memory) and then read that data and print all of the objects of class on screen! can some one he...
[2 replies] Last: take a look at <http://www.cplusplus.com/doc/tutorial/dynamic/ > and ... (by Mal Reynolds)
operator+ overloading
 
Hey I've tried to look at many examples but I just can't seem to get it. I'm trying to add 2 vectors and their components using the '+' operator. Here is my cod...
[2 replies] Last: The + operator has two forms for overloading. As a member function:... (by Duthomhas)
by denon6
how much memory in my computer
 
hello .. does anyone knws how to write a program or small function to check how much memory is installed in the computer ? i have tried so hard to try this b...
[3 replies] Last: Try GetPhysicallyInstalledSystemMemory from Windows API: http://msdn... (by Bazzy)
by ARWA
i have an questoin
 
in my prog my output is like this : 345268746.34 7854287532.63 ...
[5 replies] Last: thanks guys verey much yes its true we use setw i figre it out , im ne... (by ARWA)
by flux00
const pointer issue
 
Hi, I'm writing a ray-tracer wherein one HitPoint object is passed between all the Intersectables in the scene. The Intersectables then store a pointer to thems...
[10 replies] Last: oh that actually worked, thanks. I think I was over-thinking it. ... (by flux00)
by Null
Writing data structures using fstream write()
 
This won't compile: struct s { char anything; }; int main() { s st; fstream file("x.txt"); file.write(st,sizeof(st)); //this won't compile file.c...
[3 replies] Last: Yes, do not just copy the bitpatterns of a structure to file. You shou... (by Duthomhas)
Good Programming practice ?
 
Hi Guys, Currently I am working on a project that involves extensive use of map, list, and vector. Following some good programming practice, I have made...
[14 replies] Last: Sorry for not being clear. I was asking exactly what you explained. Th... (by kevinchkin)
Sorting part of a vector
 
Hello, In a vector of integers, I would like to sort elements whose indices are between 24 and 42. This code sort(myvector.begin()+24,myvector.begin()+...
[2 replies] Last: I got it ! First s/42/43/ . The other point is that I expected my com... (by Alexandre)
by sqrt
implicit POD ctor
 
Hello! struct MyStruct { int a; int b; }; struct AnotherStruct { MyStruct mySubData; char string ; }; class MyClass { private...
[1 reply] : AnotherStruct's default constructor, since it is not defined, will cal... (by jsmith)
What's After The Tutorials?
 
I am almost done with the tutorials on this site. I have been thinking that the next thing to do is learn the windows API, but is that correct? Or is there ar...
[5 replies] Last: Well written C is likely to compile fine with a C++ compiler. If you ... (by Bazzy)
by yol
Creating Application
 
Hi guys.. How to use C++ programming to create application for detection and tracking of object using stereo vision camera.. whats the algorithm behind detectio...
[2 replies] Last: How to write a program to link with a stereo vision camera when the .... (by Bazzy)
Writing files with no defined directory
 
hi, I am new to C++ but have programmed in C# and java before. so far i get the basics of C++. my problem is when i want to write a file use; #include <fstr...
[2 replies] Last: great thanks. (there will be more questions to follow :D) (by dobby156)
how to Reverse bitwise & operator
 
Hi, I'm new to bitwise operations. Please help me to do this: var str = "some string" for each characters in str: past char & this char thi...
[5 replies] Last: The key to this problem is doing things in the correct order. origina... (by helios)
Multiple Module Arrays
 
hello, I can't figure out how to create an array that can be called from any module. Global or public sounds familiar but they don't work. Cheers.
[2 replies] Last: Double post: http://www.cplusplus.com/forum/beginner/15637/ (by Bazzy)
Converting string types
 
I've been trying to figure out how to convert a c string that uses a char pointer to a wide c string that uses a wchar_t pointer. I can't figure out what functi...
[18 replies] Last: OK, Most of the functions with a '_' in their name aren't standard. ... (by Bazzy)
Question with dynamic arrays
 
I have been racking my brains on this program and im so lost now this is what im told # You should use dynamically allocated arrays to store the student...
[7 replies] Last: addStudent isn't inserting new name. It simply tacks it on the end af... (by kbw)
Can I use templates with operator methods/functions?
 
Is it possible?
[1 reply] : yes (by jsmith)
c_str() causing difficulty
 
I have a function that is giving me a LNK1120 error. I am using visual studio and including <string>. Any ideas? int hash(string temp) { const char* key ...
[4 replies] Last: All of that would lead to compile-time errors, not link-time errors. ... (by jsmith)
October 2009 Pages: 1... 34567... 17
  Archived months: [sep2009] [nov2009]

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