just working through my logic on paper and realised its wrong which puts me back to square one anyone have any ideas?
Type: Posts; User: Rasher
just working through my logic on paper and realised its wrong which puts me back to square one anyone have any ideas?
i tried using islower and had no succcess maybe i did it wrong
(islower(guess))
just read your post again and can already see thats not what you ment
i tried this and failed
int a=0;
int i;
int j;
for(i=0;i<4;i++)
{
if(userguess[0]==answer[i])
{
im in the final stages of writing mastermind and im down to the white pegs
i have 2 char arrays with 4 elements in each i.e
userguess[4]
answer[4] the answer is randomly generated
i need to...
i have temp fixed it to work if there is a better way please let me know
for(i=0;i<n;i++)
{
cout <<"\nPlease enter guess " << i+1 << " ";
cin >> guess[0];
while(guess[0]>=91)
{...
sorry it compiles fine what i wanted it to do was if they entered a lowercase char into guess[0] to prompt them to enter a capital and loop until they entered a capital. At the moment it accepts both...
hey guys im trying to test for lowercase and prompting user to enter uppercase this is what i have done but does not work any help would be appreciated thanks
for(i=0;i<n;i++)
{
cout...
i know this is probably not the correct way to have done it but this seems to work
#include<stdio.h>
int main()
{
int days = -1;
char quit = 'c';
printf("Insert days to convert into...
sorry thats me not being very clear again!
i would like the loop to terminate on just one letter such as 'q'
ok this is one thing i cannot get my head around and im sure its easier than im trying to make it in my head
#include<stdio.h>
int main()
{
int days;
printf("Insert days to convert into...
Ok thanks thats what i thought
Thanks the for loops are actually starting to make sense now, i thought i would have to declare the variable letters before the loop
I understand about the -1 being the terminating zero and now...
ok it works now i used gets() instead of scanf although im still not too sure why scanf wouldnt work? i think its because scanf() stops processing at the first space so it wouldnt read both names,...
Ok my bad when i compile the second lot of code it asks for your name then the program terminates it does not then print it backwards.
as for the (int)strlen(name) ive only done c for about a week...
hi folks could someone guide me on this
ive written a program that prints a character array backwards, if i state the character array it works fine
insert
#include<stdio.h>
#include<string.h>...
thanks i solved it by doing the following
input
#include<stdio.h>
int main()
{
int num;
int go;
printf("please enter a integer: ");
scanf_s("%i",&num);
i have this really annoying problem that i just cant figure out!
im sure its quite simple, i need to get a number from the user then print the number up to the next 15 places so if i enter 10 it...