Forum: C++ Jun 26th, 2009 |
| Replies: 3 Views: 247 It's just a sample I made to hilight the compile error. I might use the template parameter on other methods I didn't post. |
Forum: C++ Jun 26th, 2009 |
| Replies: 3 Views: 247 take a look at this code:
template <class T>
class C {
public:
class A {
protected: |
Forum: C++ Feb 11th, 2009 |
| Replies: 1 Views: 452 ok, so visual C++ is not C99 compliant, but I was wondering how can I access fixed bit length integer types as the one defined in stdint.h (intN_t).
thx in advance |
Forum: C++ Dec 8th, 2008 |
| Replies: 6 Views: 1,236 ok, i know this is an old thread and i'm not suppose to bring it up again, but I find this iteresting.
I posted before a method of providing a wrapper class that deletes an object after X seconds.... |
Forum: C++ Nov 19th, 2008 |
| Replies: 1 Views: 305 http://en.wikipedia.org/wiki/Dynamic-link_library
just read this. It's quite well explained |
Forum: C++ Nov 19th, 2008 |
| Replies: 2 Views: 615 Ok, i found the problem.
The CBitmap bitmap object from OnDraw(CDC*) took a handle to the bitmap and on destruction deleted the object pointed by the handle |
Forum: C++ Nov 18th, 2008 |
| Replies: 2 Views: 615 I have a document/view aplication that opens a bitmap
I use the following OnDraw override to draw the bitmap on a window and OnOpenDocument to opening the image from file
The bitmap handle (... |
Forum: C++ Nov 14th, 2008 |
| Replies: 6 Views: 1,236 Hmm, i find this question very interesting, and as ArkM said, it's very run-time environment dependent...
I tried to implement a wrapper class that takes an dynamic allocated object and destroys it... |
Forum: C++ Nov 10th, 2008 |
| Replies: 3 Views: 372 ok, u solved your problem, but still there are some problems you should notice:
1. never put function definitions inside a header file, just the declarations. If you want to include that header in... |
Forum: C++ Nov 7th, 2008 |
| Replies: 11 Views: 1,078 http://www.scribd.com/doc/3048219/expert-c-programming?from_related_doc=1
read from page 230 |
Forum: C++ Nov 6th, 2008 |
| Replies: 5 Views: 1,570 Well, C++ is just a language, with quite a small standard library, but with A LOT of provided compilers, frameworks and third party libraries. From my point of view ( and many others, I think ) g++... |
Forum: C++ Nov 4th, 2008 |
| Replies: 6 Views: 798 hmm, i think you are wrong here. I mean i'm shure you are wrong here. On my STL implementation std::map has a template specialization that for char* keys uses the char* content to identify keys, not... |
Forum: C++ Nov 4th, 2008 |
| Replies: 6 Views: 798 map<char*,int> is ok for he's requirements. He just has to count them, not have them in a sorted dictionary |
Forum: C++ Nov 3rd, 2008 |
| Replies: 6 Views: 798 char *stringarray[] = { "mama", "tata", "bunica", "mama", "tata", "georgel" };
map< char*, int > mycountingmap;
for ( size_t i = 0; i < sizeof( stringarray ) / sizeof( char* ); ++i )... |
Forum: C++ Oct 31st, 2008 |
| Replies: 2 Views: 913 come on people, is there nobody who uses static analysis tools around here? something splint like, but for C++ not C... |
Forum: C++ Oct 31st, 2008 |
| Replies: 2 Views: 913 ok, I've checked the forum and I don't think this topic was touched.
What I would need is an open-source or at least free static analysis tool for C++ code.
Does anybody have any suggestions? I... |
Forum: C++ Oct 30th, 2008 |
| Replies: 7 Views: 696 well, i wrote the index version too. but the thing is they both mean the same thing... using an index won't protect you from going beyond the array's size... |
Forum: C++ Oct 29th, 2008 |
| Replies: 7 Views: 696 you did not allocate memory for the int* Tests variable.
the thing is I have a
testScores = new int[numTests];
but you don't use that nowhere
Now, the thing is like this
Reading your... |
Forum: C++ Oct 28th, 2008 |
| Replies: 2 Views: 611 hmm, the thread name is kind of missguiding
this should better be "error linking to loki"
as you can see all your .o files compile fine, but the linking is the problem
did you build the Loki... |
Forum: C++ Oct 24th, 2008 |
| Replies: 2 Views: 344 std::fstream BoardFile;
BoardFile.open(arrayFileName->c_str()); |
Forum: C++ Oct 24th, 2008 |
| Replies: 4 Views: 517 u shure the library actually is at that path? |
Forum: C++ Oct 24th, 2008 |
| Replies: 3 Views: 449 your vector has no reserved sizes, so all insertions
//option 1
vector < vector<int> > grades;
for(int i = 0; i < 30; i++)
{
vector<int> tempVec;
for(int j = 0; j < 20; j++)
{... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 2 Views: 1,431 |
Forum: C++ Oct 21st, 2008 |
| Replies: 4 Views: 1,942 i think you could system("grep -c keyword file1.txt > myfile");
and then read myfile for the output. |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 930 #include <iostream>
#include <algorithm>
using namespace std;
template<class T>
class myPointer
{
public:
T* pT_; |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 930 well, this is the "good" way of doing it... of course... you could find a workarround that would kind of be based on the same principle... I'll try to make a short implementation. |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 930 http://www.onlamp.com/pub/a/onlamp/2006/05/04/smart-pointers.html?page=1
try reading this... it's kind of long, but it also explains the RAII idiom and a large variety of smart pointers.
If your... |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 930 there are a lot of things I don't understand in your code, or that seem wrong
struct node
{
device * devicePtr;
node * left, * right, * next;
node(const device * dvptr) {... |
Forum: C++ Oct 20th, 2008 |
| Replies: 2 Views: 398 Anyway, this is OS dependent, but I really can't find any other way except the looping. Another way would be to check all the interrupts at kernel level and see what system calls refer to your folder... |
Forum: C++ Oct 20th, 2008 |
| Replies: 4 Views: 553 to solve the compilation error u have to forward the declaration of class device. That means simply add a class device; before you declare BST
good luck |
Forum: C++ Oct 20th, 2008 |
| Replies: 12 Views: 928 Then what are they written in ? MonkeyLanguage? |
Forum: C++ Oct 17th, 2008 |
| Replies: 2 Views: 1,367 hmmm, ok, sorry, but your ideea with the file being the chatroom or whatever just isn't good !!
First of all, you have to synchronize all acces to that file. When one user is writing the file all... |
Forum: C++ Oct 17th, 2008 |
| Replies: 3 Views: 564 well, you will defenetly won't find any divisors greater then n/2 !! so, instead of iterating to n-1 you could just iterate to n/2. Another thing would be that if a number doesn't have any divizors... |
Forum: C++ Oct 15th, 2008 |
| Replies: 5 Views: 452 aaaaa, what game?
#include <iostream> //for opengl and directx support
int main( int argc, char* argv[] )
{
cout<<"pick a number from 1 to 5"<<endl;
int x;
cin>>x; |
Forum: Viruses, Spyware and other Nasties Oct 15th, 2008 |
| Replies: 2 Views: 398 Sounds like a nasty virus. Try booting in safe mode and see what happens. Mabe you cold do a System Restore and then have an antivirus scan you pc. Good luck. |
Forum: C++ Oct 8th, 2008 |
| Replies: 7 Views: 471 of course the pointers in the structs point to the same thing. That is because you do a shallow copy. If you want the two char pointers inside the structs point to diffrent strings you need to do a... |
Forum: C++ Oct 8th, 2008 |
| Replies: 5 Views: 640 It works just fine for me. I just added the followng lines to your program:
client side:
char buff[16] = "mamaaremere";
send( sockfd, buff, 16, 0 );
server side:
char buff[16];
int... |
Forum: C++ Oct 8th, 2008 |
| Replies: 5 Views: 640 try posting the entire problem ... i mean your assignment requirements and how you thought about implementig it. Then I will probably be able to help you with it a bit more. |
Forum: C++ Oct 8th, 2008 |
| Replies: 5 Views: 640 ok, what u posted is just the connection part.
What do you mean they don't interract? I mean, u know u have to send messages from server to client and from client to server via send, recv || write,... |
Forum: C++ Oct 7th, 2008 |
| Replies: 0 Views: 1,129 ok, long story make it short
I have a quite large project, a makefile and gnu make. All runs fine.
Trying to port the project to windows, and building with mingw32-make I come accross some... |