oops...yep...you are right...damn typos :) *edited to fix*
srand() seeds the random # generator with a value. If you do not srand() before you generate numbers then the same 'random' numbers might...
Type: Posts; User: biz
oops...yep...you are right...damn typos :) *edited to fix*
srand() seeds the random # generator with a value. If you do not srand() before you generate numbers then the same 'random' numbers might...
#include <time.h>
#include <stdlib.h>
...
srand(time(NULL));
x=(rand()%(N+1)); // Generate random # between 0 and N
x=(rand()%(end-start+1)+start); // Generate random # between start...
No update? The link doesn't work anymore unfortunately, and I would like to see what you have done.
look up ncurses...it will do all you need and then some.
I wouldn't call my life "troubled". Have a life, have a gf, program for a living and browse this board while I work :). I love my life.
Take your pitiful attempt at making yourself feel better...
That would take up 100 bytes of memory. For information on dynamic memory, lookup the operators new amd delete.
This is actually a tad incorrect. array[50] actually defines a pointer which points to the first item in an array. Example:
char blah[10]="hello";
cout << blah << endl << (blah+1) << endl;
This...
zip file has a bad CRC...you need to re-upload.
The first time you buy a weapon, all is fine.
The second time you buy a weapon, this error/crash occurs.
Hope that helps you find the bug and squash it...I'd help, but you didn't include the...
no problem...hehe yea...I am the typo master ;)
Try this:
#include <iostream.h>
#include <string.h>
struct weapon
{
char name[15];
There are a few ways to hold different sized arrays of strings in memory. Two off the top of my head:
a1) If I recall correctly, many compilers as of late include some sort of string class which...
Well it compiles fine on my system after I include iostream.h
*shrug*
You are missing iostream[.h]
#include <iostream.h>
struct weapon
{
char name[15];
char Wclass[6];