'endl': undeclared identifier
uyarısı alıyorum. void fonksiyonun içinde kullandım diye mi oldu ki? yoo void içinde bunları yapmicaksak napcaz zaten. ya çok saçma be bi el pls.

kodu paylaşırsan daha iyi yorum yapılabilir.


void diye olmaz. tek farkı void'de return değeri yoktur.


#include <iostream>
#include <cstdlib>
#include <ctime>
/*
Write a program that simulates coin
tossing experiment for 1000 times.
The program will print the total
number of heads and tails.
*/
void flip ()
{
srand(time(0));
int a, heads, tails;
for (int i=1; i<=1000; i++)
{
a=rand()%2;
if (a==0)
heads++;
else
tails++;
}
cout<<heads<<" times for heads."<<endl;
cout<<tails<<" times for tails."<<endl;
}
int main()
{
flip();
return 0;
}


using namespace std;
eklemelisin void flip() ten önce.
veya std::cout ile std::endl şeklinde de kullanabilirsin.


aa, belliydi noob olduğu eyvallah sağ olun.
