Nah, i thought that i would need it for some reason, thanks for spotting that
Type: Posts; User: petedee
Nah, i thought that i would need it for some reason, thanks for spotting that
heh, I've just being playing with my code and it seems alot easier to just use booleans, i actually noticed how to fix the errors only a few minutes after i posted, guess i should spend more time...
Bugger! well that would teach me to follow our instructions won't it? :p
Now it actually works, i have another quick problem! Is there something in c++ that says that double length floating...
This is the whole thing:
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::fixed;
Would it be possible to call a function from within a function? I have being set a task which requires me to do a calculation in one function and without returning a value from either function, when...
I tried that as one of the first things, i just got a whole heap of errors chucked at me, plus we're not really allowed to use regular C code as that is what we've being taught up to now, I'm pretty...
dependency???? :confused:
This sounds a damn sight more compliacated then i thought it would be, if its any help I'm using microsofts visual c++ on windows xp pro using the british character set. Is there no way just insert a...
This seems such a simple problem but I've got no way to put the "£" into my code, all i get is the "ú" symbol?
if its wrong how come it compiles without any errors and works fine? Still I've handed it all in so there is very little i can do now :(
Final code: http://rafb.net/paste/results/p2052581.html
Took less time than i though, added loads of comments and removed some stuff i didn't need.
Thanks again for all your help, even added a...
Its ok, I've had it running for about the last hour or so, I've just being trying to add all the comments and do the documentation before 9am tomorrow morning (its 2am now!) It should be all done and...
since you say that it returns a char value, I'm assuming that i need to run those if statements outside the function?
I've tried it but i guess this isn't in the right order?
scanf("...
Is this what you are meaning to do tzuchan?
int usedcharacters (char usedchars [], char let2bg)
{
int k;
for(k = 0; usedchars[k] != '\0' && usedchars[k] != let2bg; k++); /*loop until...
So is there an easy way that i can add a terminating character to the end of the string? printing the characters out in that method you suggest still turns up rubbish, I've altered the loop to only...
I've being racking this over in my head and i just can't see any way to do it, i thought about using an if statement to check it something along the lines of:
for (k = 0; usedchars [k] !=...
Damn bugs! one more then i swear thats it!
Ok so I'm checking to code to see if the same letter has being guessed more than once, I'm guessing i'll need to pass the function the letters which are...
Its all fixed! Thanks for you help guys, doubt i could have ever done this without your help :)
So rather than count correct letters count the ones the blanks that are left? would i be better off putting that in a new function?
Actually i think i know what you mean...
int checkchar(const char let2bg, char word2bguessed[], char usercorrect[], int correctguess)
{
int i;
for (i = 0; word2bguessed[i] !=...
So i need to set up a pointer to the correctguess value then? or would there be an easier way to do this outside the function?
OK more bloomin bugs, this one is getting me. Here is the situation, the user enters all of their data and gets the word right? How can i tell them that they have won? I thought a simple if statement...
YAY! thanks for all your help, doubt i could do this without ya, cheers fella, all I gotta do now is remove the bugs and the obvious holes but the majority of it works yay! :) :D
No problem, its all on http://rafb.net/paste/results/A1969227.html
I kinda get what you mean now:
code:
int checkchar (const char let2bg, char word2bguessed [], char usercorrect [])
{
int i;