Seite 1 von 1

[gelöst] Programm wird nicht richtig ausgeführt

Verfasst: Fr Aug 29, 2014 11:29 pm
von AlexImperator

Code: Alles auswählen

#include<stdio.h>

void sayhallo (int times);

int main(void)
{
//programm gibt hallos Hallos aus
//es werden aber nicht mehr als 5 ausgegeben
 int hallos=16;

	void sayhallo (int hallos);

	return 0;
}

void sayhallo (int times)
{
	if(times>5)
		times=5;
	
	int i;
	
	for(i=0;i<times;i++)
		printf("Hallo\n");

	return;
}
programm gibt nichts aus

compiler sagt varible hallos wird nicht benutzt... hilft mit aber nicht weiter
ich vermute der aufruf ist falsch....

Danke im Voraus :)

Re: Programm wird nicht richtig ausgeführt (seh fehler nicht

Verfasst: Fr Aug 29, 2014 11:44 pm
von cloidnerux

Code: Alles auswählen

   void sayhallo (int hallos);
Hast du so einen Funktionsaufruf schon mal gesehen? :D

Re: Programm wird nicht richtig ausgeführt (seh fehler nicht

Verfasst: Fr Aug 29, 2014 11:53 pm
von AlexImperator
ohh war ein bisschen verplant xD

Code: Alles auswählen

sayhallo (hallos);