thank you.... yes, I had finally figured it out but I can't understand why there would be a version of the function (the 2 parameter one) that is essentially "not very random" - weird!
I have been using srand((unsigned)time(NULL)) at the beginning of main() to seed it and I'm still getting the problem. Here's the code and output:
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
using namespace std;
int main(void)
{...
Hi all, does anybody know why random_shuffle() does not appear to be random at all. I mean, no matter how I try to "seed" random_shuffle() always returns the same results!
Thanks in advance!
Hi, I can create a Tab Control successfully without using MFC - however, I'd like the tabs to be vertical and to the right. I've tried everything it says on MSDN but it's just not working.
Has anybody worked with Tab Controls (without MFC) before? Does anyone know how I can do this?
Thanks
Hi all,
I have been experimenting with the CSocket class and have built a small client program and small server program which I have tested on two separate PCs over an internet connection.
One of the PCs is running Windows XP and the other Windows95. When I set up the client on the XP machine...
How about another ToString() function that works to a precision:
CString CDouble::ToString(int precision)
{
char buffer[20];
_ltoa((long)m_Int,buffer,10);
CString str = buffer;
str += ".";
_ltoa((long)m_Fract,buffer,10);
CString fStr =...
Hi all,
I have a MDI project where I have added a second document/view type. Everything is working great except for one silly thing: the print and print preview menus are disabled and do not work with my second document type.
I've looked through all the code and compared with my original...
Hi all, does anybody know how I can make a selection extend all the way across a CListCtrl in report view. Currently, I can only select an item if I click in the first column. Also, it is only the first column that becomes highlighted when selected.
Hi, I have a multi-document project which, when launched, automatically opens a new document. This is obviously because of the settings I put in when I created the project.
However, I would like the user to determine whether this happens on launch through options/preferences. Only problem is, I...
Hi all,
I have a multi-doc program, each doc having one main CScrollView view to display doc contents. Everything is working perfectly except for one silly little thing...
When I am resizing a document the document contents flicker - almost like the background is being erased - as I drag the...
Certainly made my life easier!!! I'm a new VC++ user and was wondering about buffered drawing in VC++. I downloaded qednick's library and gave it a shot.
The library is simple to install and use and works great. Not only that but anything that makes my project code look neater (and easier to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.