Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Please help..

Name: Anonymous 2013-11-19 1:40

// ConsoleApplication6.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>


int valid(int);

int main(void){
int i, num;
int input[1][4];
//int guess[1][4];
char test;

printf("To begin, you need to enter four numbers between 1 and 4 below.\n");

// User Input and checking
do{
for (i=0; i<4; i++){
printf("Please input an integer between 1 and 4: ");
//scanf_s("%d", input[1][i]);
input[1][i] = getchar();
}
}
while(test != valid(num));

printf("\n%d", input[1][4]);

return 0;

}

int valid(int input[1][i]){
if (input[1][i]<1 && input[1][i]>4)
return 1;
else
return 0;
}

Name: Anonymous 2013-11-19 1:56

apparently I have to declare the identifier i called in the function valid. I'm not sure how to do this without losing the value from the main. First semester with C++, not to good at coding yet

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List