Thanks for the link, my mind must've slipped as this could also be done.
float k = (rand()%10);
k = k/10;
Type: Posts; User: DarrenY
Thanks for the link, my mind must've slipped as this could also be done.
float k = (rand()%10);
k = k/10;
Hi, I'm wondering how do I generate random numbers in decimals?
Meaning between 0-1.
Any ideas? rand() returns from the minimum of 1.
But my Base class is an abstract class which is a .h file. Where do you recommend me to put the operator?
Thanks alot. I kind of manage to implement it in my work.
So do I put the operator overloading in the base class or on the derived classes?
*EDIT
Apparently, it clashed with my other display functions from the same objects, or so I thought.
...
*EDIT
So its like
class base
{
public:
virtual ~base();
};
Hi, I'm having trouble with the destructors of a derived class from a base class, here are the codes
Base Class of Asteroid.h
#ifndef ASTEROID_H
#define ASTEROID_H
#include <QPainter>
...
Thanks for the advice but I'm sorry, I find it this quite hard to swallow. My current work now is to analyze various data storages and std::list is one of them.
My object classes are derived from...
Is it possible if I can grab the head pointer of the list and craft my own display list instead of using the template, this of course is a more targetive approach? If possible, what do you recommend...
Hi,
I'm new to this so I'm going to be direct. I'm having trouble with custom template of a Linked List. I've created a Linked List with a reference from a book but I'm at a lost when I store in...
Thanks alot! I'm sorry about my unnessary includes because my assignment happened to be so large I sometimes get really messed up. Its the first time I'm doing C++.
Thanks ZuK and Desolation!
Hi,
I'm having trouble compiling, after writting a few lines of code, suddenly my compiler throws me an error. The error is :
GameWorld.h:38: error: ‘AsteroidList’ does not name a type
...
Hi,
I'm running into trouble here as I'm programming C++ with QT4.3.
Here's a snippet
#Asteroid.h
#ifndef ASTEROID_H
#define ASTEROID_H
Thank you, by doing that, it showed me something new towards debugging it. It seems that my integer somehow jumped above the buffer I specified. I've made a few more changes but still doesn't solve...
to get my buffer limit which is a pre-requisite to my project. I could just easily have
buffer_size = atoi(argv[2]);
I've made some changes to my first post and posted another problem...
My apologies, I have found my problem, at
strcpy(tempBuffer_size,argv[2]);
buffer_size = atoi(tempBuffer_size);
temp_buf = buffer_size - 1;
When I run the gdb debugger, I has this
Program received signal SIGFPE, Arithmetic exception.
0xff2a3120 in .rem () from /lib/libc.so.1
But it didn't point me where is it.
Hi, I'm having a problem with my program, whenever I try to run it, it gave me a Floating Exception (Core Dumped), here's the code :
#include <stdio.h>
#include <stdlib.h>
#include...
I'm still unable to figure out why did a duplicate copy entered my first record. Any ideas?
This is my output in strings
Output :
Record1 :
Timmy...............
John................
Hi, I'm running in a little trouble here. I have a hash functions which hashes a string into a hash table that is linked via linked list. It seems to produce duplicates in my node. Here are pieces of...
I see..thanks Salem!
I can't really post any codes, from what I understand from the quote, I tried using printf, fprintf with or without the flag, it still prints both strings.
E.G.
./sample -d
All I did was a...
Hi, I've been googling through the internet trying to find articles and sample on the optional flag in commandline argument. I was hoping someone could point me to the right direction for the...
Its in C#. I'm relatively new in C#, perhaps its because of the size I've declared? What should I do to overcome this? I thought that
line.Length
on the for loop would just traverse until...
Hi, I wrote 2 programs which encodes and decodes a text file. Upon decoding, it decoded my original text but also added something extra. Here is my piece of code, could anyone kindly explain this...