PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : C Progamme unter IRIX kompilieren?



linuxhanz
13.11.02, 11:28
Hi


Ich möchte dieses Prog unter IRIX kompilieren. und bekomme den Fehler
Wrong Architecture. Ist ja auch klar, weil für gnu Linux geschrieben.

Was muss man denn jetzt ändern?


/************************************************** ******************
* Description:
* Author: usr@linux <>
* Created at: Wed Oct 30 16:41:59 CET 2002
* Computer: linux
* System: Linux 2.4.18 on i686
*
* Copyright (c) 2002 usr All rights reserved.
*
************************************************** ******************/
/*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <stdio.h>
#define cls printf("\x1B[2J")
int main () /* void main kompiliert unter unix nicht */
{
int Jahre;
float Kredit, Zinssatz, Rate, Zinsen, Zinssumme;

cls;
printf("Kredit:"); scanf("%f",&Kredit);
printf("\n Zinssatz:"); scanf("%f",&Zinssatz);
Zinsen = Kredit * Zinssatz / 100;
do
{ printf("\n Rate:"); scanf("%f,&Rate");
} while (Rate <= Zinsen);
Jahre = 0;
Zinssumme = 0;

while (Kredit > 0)
{
Jahre ++;
Zinsen = Kredit * Zinssatz / 100;
Kredit = Kredit + Zinsen - Rate;
Zinssumme += Zinsen;
}
if (Kredit < 0)
{
Rate += Kredit;
printf("\n letzte Rate=%7.2f DM",Rate);
}
printf("\n Laufzeit:%i Jahre",Jahre);
printf("\n Zinssumme=%8.2f DM",Zinssumme);
}


Im Voraus danke für eine Antwort, das ist wichtig für mich damit ich nicht mit MS C++ arbeiten muss.



Bonus:
Und wie stellt man 100 Fakultät in C dar?

reno
13.11.02, 11:54
Ja griaß Di,

bei mir funktioniert das proggi.
Da ist übrigens ein Fehler drinn.


Original geschrieben von linuxhanz
printf("\n Rate:"); scanf("%f,&Rate");

muss wohl heissen: printf("\n Rate:"); scanf("%f",&Rate);

Getestet auf 'ner Indy mit IRIX 6.5 und 'nem MIPS R5000(IP22) Prozessor.