actually, i ended up writing this:
int comp(char * char1, char * char2){
int i = 0;
while ((char1[i]!=(int)0)&&(char2[i]!=(int)0)){
if(char1[i]!=char2[i])
return 0;
Type: Posts; User: pik_d
actually, i ended up writing this:
int comp(char * char1, char * char2){
int i = 0;
while ((char1[i]!=(int)0)&&(char2[i]!=(int)0)){
if(char1[i]!=char2[i])
return 0;
i ment for you to put that in your int main()
#include <iostream>
using namespace std;
int main(){
int answer;
cout<<"what is 4+4: ";
cin<<answer;
what you're looking for is a loop, there's a while, do while, and for loop. i'll show you how to make it a while loop.
and, != means not equal to, instead of checking for less than and greater...
i also tried something like this:
int main(int argv, char * argc[]){
// size array
char * char1 = "-I";
char * char2 = "-o";
if (argv!=5){
can't do it that way, we haven't been taught about the cstrings library :-(
can't use what we don't "know".
int main(int argv, char * argc[]){
// size array
if (argv!=5){
cout<<"baduser";
exit 0;
}
if((argc[1]=="-I")and(argc[3]=="-o"){
char * inputfile = argc[2];
char * outputfile =...