Problems always exists!

closed account (9wX36Up4)
main.cpp
#include<iostream>
#include<fstream>
#include<stdlib.h>

using namespace std;

int zarat(int,int);

int zarat(int z1,int z2){
      int a,i;
      char zarlar;
      
      fstream Kaynak;
      Kaynak.open("Kaynak.txt",ios::in|ios::out);
      if(Kaynak.is_open()){
          cout<<"To Dice Z Button(To Exit Q)"<<endl;
          cin>>zarlar;
          if(zarlar=='Z'||zarlar=='z'){
              Kaynak>>a;
              srand(a);
              z1=1+(rand()%6);
              z2=1+(rand()%6);
              cout<<"First Dice :"<<z1<<endl<<"Second Dice :"<<z2<<endl;
              }
          else{ if(zarlar=='q'||zarlar=='Q') //Hata Var
              exit(2);
          else
              return zarat(z1,z2);
              }
              
          }
      else{
          cout<<"File Error:Kaynak.txt couldn't open"<<endl;
          return 0;
          }
}

int main(){
     char oyunubaslat;
     int z1,z2;
     
     cout<<"To Start A Button(To Exit Q)"<<endl;
     cin>>oyunubaslat;
     if(oyunubaslat=='A'||oyunubaslat=='a')
          zarat(z1,z2);
     else{ if(oyunubaslat=='q'||oyunubaslat=='Q')
          return 0;
     else
          return main();
     }
}


Sayıcı
#include<iostream>
#include<fstream>

using namespace std;

short main(){
      short a;
      
      fstream Kaynak;
          for(a=10;a<=45;a++){
              Kaynak.open("Kaynak.txt",ios::in|ios::out|ios::trunc);
              if(Kaynak.is_open()){
                  Kaynak<<a;
                  Kaynak.close();
                  }
              else
                  return 0;
              if(a==45){a=10;}
              }
}


i m trying to make a project please help me and show me what the problem is here
Don't ask for a solution if you don't explicitly explain the problem. If you are getting compilation errors, then show them here; if you are getting runtime errors, then explain them here. Personally, I don't check the code to try to find a bug without knowing more or less the situation.

In short: We don't like guessing what the problem is. Say what the problem is. Help us help you.
closed account (9wX36Up4)
u r absolutely right my mistake sorry.
the error is
1
2
Circular Sayıcı<-Sayıcı.o dependencdy dropped
[Build Error][Sayıcı.o] Error 1

I don't know what to do and this my first project work.
You cannot have more than one 'main()' function per project. Actually you cannot have more than one function with the same name
closed account (9wX36Up4)
so what can i make 'main()' in the Sayıcı??? because i m still a beginner i don't know how to solve the problem
It seems to me like Sayıcı is not using anything from main.cpp so just treat them as two different projects.
that should repaired
closed account (9wX36Up4)
Warnis i did what u said but still it didn't solved i started to feel like i m stupid somebody please help And i use DevC++
Both programs should compile fine (except that main should be int (second piece) , not short and that main should never be called (first piece) ).
The problem must be with how you compile this. These are two separate projects.
Topic archived. No new replies allowed.