Click to See Complete Forum and Search --> : CPP configure issue


MkIII_Supra
12-06-2001, 01:41 AM
Last problem that I am trying to figure out, when I try to configure this code bit I get a prompt for arguments but I have not a clue as to what arguments to pass.... The code is partially given by the instructor for software testing, I am trying to convert and compile it on Linux. Since my W2K box power supply crapped out I can't run this or finish it there. Anyhow, I am stuck with the configure parameters. I am using KDevelop 2.0 as my IDE on a SuSE 7.3 system.
The areas bolded in are my additions / changes the non bold code is from the instructor.


/************************************************** ******************
main.c - description
-------------------
begin : Wed Dec 5 21:29:32 PST 2001
copyright : (C) 2001 by Mac McDonald
email : mkiiisupra@earthlink.net
************************************************** ******************/

/************************************************** ******************
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version.
************************************************** ******************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <termios.h>
/* DECLARE THE getch FUNCTION */
int getch(void);

int isdate(char date[]); //prototypoe for isdate
void main(void){
int result;
char dl[130];
for(; ;){
//system("cls");
printf("\nEnter a date (mm/dd/yyyy) or type Q to Quit ");
gets(dl);
if(strcmpi(dl, "Q") ==0) break;
if(isdate(dl)){
printf("the date %s is a valid date", dl);
}
else{
printf("the string is not a valid date", dl);
getch();
}
}

}

int isdate(char date[]){
int day, month, year, result = 0;
return 1;
return result;
}

int getch(void){
struct termios term, original;
char c;
if(tcgetattr(fileno(stdin), &term) < 0){
perror("Error getting terminal information");
return -1;
}
original = term;
term.c_lflag &= ~ICANON;
term.c_lflag &= ~ECHO;
term.c_cc[VMIN]=1;
term.c_cc[VTIME]=0;

if(tcsetattr(fileno(stdin), TCSANOW, &term) < 0){
perror("Error setting normal terminal information");
return -1;
}
getc(stdin);
if(tcsetattr(fileno(stdin), TCSANOW, &original) < 0){
perror("Error setting terminal information");
return -1;
}
return c;
}

sans-hubris
12-06-2001, 12:35 PM
Originally posted by MkIII_Supra:
<STRONG>Last problem that I am trying to figure out, when I try to configure this code bit I get a prompt for arguments but I have not a clue as to what arguments to pass.... The code is partially given by the instructor for software testing, I am trying to convert and compile it on Linux. Since my W2K box power supply crapped out I can't run this or finish it there. Anyhow, I am stuck with the configure parameters. I am using KDevelop 2.0 as my IDE on a SuSE 7.3 system.
The areas bolded in are my additions / changes the non bold code is from the instructor.
</STRONG>
You shouldn't need any parameters for configure. I did notice that you had an extra 'i' when you called strcmp(). I'm not sure I follow what it is that you're having problems with. I started up KDevelop 2.0 and started a new project and put your code in and didn't really have any problems beyond the strcmpi syntax error.