#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#define MAX 5
#define MAX2 10
Type: Posts; User: Bradley Buck
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#define MAX 5
#define MAX2 10
This is what I have now:
for(incr=MAX2 -1;incr >set_pt;incr--) //this for loop will make room in the array for the new data insertion
{
player[incr] = player[incr-1];
...
If someone knows a good tutorial on copying into arrays that might help.
Well, I generally try to read his code first and then write my own based on it, but I was in a hurry this time so I though I could just copy it in and figure it out as I went along, but I don't think...
The professor provides us with examples which we can incorporate into our projects. We're supposed to incorporate the code and then figure out how it works.
I can get the score into the array, but my problem is that I can't get a player name associated with the score.
I need to write the new high scores to the array after it is incremented and I'm not sure how to do it. I'm pretty new to this stuff.
when I put for(;set_pt < MAX2;Gnd_it = player[set_pt].score); it compiles, but only saves one high score. If I put for(set_pt=0;set_pt < MAX2;Gnd_it = player[set_pt].score); it refuses to go back...
Oh right. Sorry. So if I want to write an integer into an array, what would I use?
Here's what I added to setpt: for(set_pt=0;set_pt < MAX2;strcpy(Hld_it, top_scores);
it gave me this error: Error 2 error C2664: 'strcpy' : cannot convert parameter 1 from 'int' to 'char *'
How do I write the new data to the array? I tried using strcpy but it didn't work.
Hi. I'm hoping someone can help me with a project I've been working on. I need to create a game a user enters a name though a menu option and then guesses a number, then the lowest number of tries...