u know what.... i'm just going to revert back to the original code where the user would have to input a character at a time and submit my assignment... i'm sick of being picky, spent more time trying...
Type: Posts; User: OrAnGeWorX
u know what.... i'm just going to revert back to the original code where the user would have to input a character at a time and submit my assignment... i'm sick of being picky, spent more time trying...
i misunderstood what you meant, i'm sorry, i believed u meant something else... it's been a few days that i'm not getting sleep and i'm just staring at the pc screens and i have the final exam...
I'm certainly not lying but rather lost...
I've changed the line you mentioned to codeCopy[j] = secretCode[j];
now, even if u put in the correct color sequence, it doesn't accept it
here goes nothing
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define NBCOLORS 4
#define NBTRIES 6
yes i have.. but I'm still getting the same color combination when i choose to replay.
this one:
int main (void)
{
char secretCode[NBCOLORS];
createCode(secretCode);
while(playGame(secretCode));
return 0;
}
because it's not in the realm of this class :S
i hate it when i just can't make sense of what's going on and get totally lost... i feel like scrapping the whole file because I just can't see...
i don't even know what we're talking about anymore. which ones are you referring to ?
i'm confused....
in the first one, secretCode is an integer (but it is initialized as char in main)
and the second one has a char table[] for an argument...
#include <stdlib.h>
#include...
i get you, i need to call createCode at the point the program "restarts"
in the playGame function... just having some issues coding it... i'm getting some syntax error befor char...
int...
once in main...
just wanted to say thanks for baring with me, I'm just finding it hard to relate the material I'm being taught (in French) with what you're saying and a lot of what we're told seems to be a load of...
i tried commenting fflush line and now it takes the whole string and gives out proper output
so the fflush was not supposed to be there... it seems.
i tried a few runs at the code, selecting o to...
so getchar() only picks up a character at a time, is there any other way i can pick up a whole string, then for loop it to place each character of the string in a table?
well it does work......
i follow you but it's puzzling me more.
i'm not really sure what to do now. Am i supposed to move the fflush command to the main? And why would c = getchar() only pick up 1 character at a time ?...
well we were advised to use the fflush command so that no residual info is kept in memory at every code entry... i thought it was the right way to code this in.... the program works ok if the...
Hey guys, I was wondering if there was a way to scanf/getchar() a string of characters into a table ?
Am i shooting for the stars or is it a possibility ?
what I'm trying to do is basically have...
I believe this will conclude this thread on a good note... I've been able to get it done, i can now say it's running error free
here's the code with example results
thank you tabstop, A+ buddy!...
i feel like lynching myself, this is disgusting, i'm gagging
i'm an idiot
i went and added
#define max 10
and changed the references in the tables.... ctrl+F10, input info... tada!
there's...
as far as the requirements go, they are what they are... i'm also beginning to think if i had that maximum number of animals (like in most of the teacher's examples where there's nothing dynamic but...
well it's because these are the requirements of the assignment... need to have tables, loops and stats/counters...
it would've definitely been so much straightforward had i been able to just scanf...
when i open the compiling window, i have execute paramets... i put in -std=c99 as you directed...
nothing changed, nothing "visible" that is.
tabstop... i really appreciate the help
running the program again... only using males
results:
SVP entrez le nombre d'animaux pour vos calculs:
2
Animal 1
entrez sexe (M/F)
M
entrez l age en jours
12
in the options, would it be attempt to support some aspects of traditional C preprocessors?
i'm using Dev-C++ v4
the ageMoyenM and ageMoyenF are for the age average for males and females... i had commented out the lines that calculate these as they were crashing the program for some reason.