'cout': undeclared identifier'endl': undeclared identifieruyarı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.
'cout': undeclared identifier
'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.
0
kodu paylaşırsan daha iyi yorum yapılabilir.
0
void diye olmaz. tek farkı void'de return değeri yoktur.
0
#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;
}
0
using namespace std;
eklemelisin void flip() ten önce.
veya std::cout ile std::endl şeklinde de kullanabilirsin.
0
aa, belliydi noob olduğu eyvallah sağ olun.
0
dediklerinden alakasız olarak şu
www.java2s.com adreste bir çok örnek mevcut.
0