Having errors in C++ code
<p>this is my code written in C++. I am using Code::Blocks. 
1st problem is whatever i do </p>

<pre><code>yenifayl2();   // newfile2
nizam();       //sort
foxuma();      //file read
fayldavam();   //file continue
silme();       //delete
yenifayl();    //new file
ekran();       //screen
daxil();       //show   
</code></pre>

<p>is not recognized. Everytime this part gives error. <strong>How to take out the Errors ?**and second problem is when u save it, it saves it in random random, **what to do so that i can choose the save file name ?</strong> </p>

<pre><code>#include&lt;string.h&gt;
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
yenifayl2();   // newfile2
nizam();       //sort
foxuma();      //file read
fayldavam();   //file continue
silme();       //delete
yenifayl();    //new file
ekran();       //screen
daxil();       //show
int i=0;int k=0;
float sumbal=0;
  struct st{char  Sadi[20];char  Tadi[20];char  Il[20]; char kod[10];
  float ehaqqi;}s[100];
  char Sadi1[20];char Tadi1[20];char Il1[20];char kod1[10];float ehaqqi1;
//*******************************************************************
  void main()

{
 int r=0;
    clrscr();Sadi1[0]='a';
  rr:printf("\n rejimler\n     1.yeni fayl\n     2.faylin davami\n     3.fayli oxu");
    printf("\n     4.silme \n     5.nizamlama \n     6.proqramin sonu   ? ");
    scanf("%d",&amp;r);
  if (r==1)
    {
  daxil();
  ekran();
  yenifayl();
  goto rr;
    }
  if (r==2)
  { daxil();
  ekran();
  fayldavam();
  goto rr;
  }
  if (r==3)
    {
  foxuma();
  ekran();
  goto rr;
    }
  if (r==4)
    {
  silme();
  goto rr;
    }
  if (r==5)
    {
  nizam();
  goto rr;
    }
  if (r==6) goto son;else {printf("\n duz daxil et");goto rr;}
 son: getch();
 }
//************************************************************************
ekran()
  {char p1=179;int kk=1;
  char Sadi2[21];char Tadi2[21];char Il2[21];char kod2[11];
  char xx[79]; char xx1[79];char xx2[79];
  char y[17]="                ";
  clrscr();
memset(xx,196,78);xx[78]='\0';xx[0]=218;xx[11]=194;xx[77]=191;xx[32]=194;
xx[49]=194;xx[66]=194;
memset(xx1,196,78);xx1[78]='\0';xx1[0]=192;xx1[11]=193;xx1[77]=217;xx1[32]=193;
xx1[49]=193;xx1[66]=193;
memset(xx2,196,78);xx2[78]='\0';xx2[0]=195;xx2[11]=197;xx2[77]=180;xx2[32]=197;
xx2[49]=197;xx2[66]=197;

clrscr();
printf("\n %s",xx);
printf("\n %c   Kod    %cSehenin adi         %c Telebenin adi  %cAnadan oldugu il%c  ehaqqi  %c",p1,p1,p1,p1,p1,p1);
printf("\n %s",xx2);
for (i=0;i&lt;=k;i++)
     {
 memset(Sadi2,' ',20); Sadi2[20]='\0';memcpy(Sadi2,s[i].Sadi,strlen(s[i].Sadi));
 memset(Tadi2,' ',16); Tadi2[16]='\0';memcpy(Tadi2,s[i].Tadi,strlen(s[i].Tadi));
 memset(Il2,' ',16); Il2[16]='\0';memcpy(Il2,s[i].Il,strlen(s[i].Il));
 memset(kod2,' ',10); kod2[10]='\0';memcpy(kod2,s[i].kod,strlen(s[i].kod));

 printf("\n %c%s%c%s%c%s%c%s%c ",p1,kod2,p1,Sadi2,p1,Tadi2,p1,Il2,p1);
 printf("%9.2f%c",s[i].ehaqqi,p1);

    if ((kk%12)==0) {
 printf("\n %s",xx1);
 getch();kk=0;clrscr();
         printf("\n %s",xx);
printf("\n %c   Kod    %cSeherin adi         %c Telebenin adi  %cAnadan oldugu il%c   ehaqqi  %c",p1,p1,p1,p1,p1,p1);
//printf("\n %s",xx2);
         }
      printf("\n %s",xx2); kk++;

     }
 sumbal=sumbal/(k+1);
 printf("\n %c          %c   orta ehaqqi      %c%16s%c%16s%c ",p1,p1,p1,y,p1,y,p1);
 printf("%9.2f%c",sumbal,p1);
 printf("\n %s",xx1);
 getch();clrscr();
  return 0;
   }
//*************************************************************************
daxil()
  { kod1[0]='a'; i=0;
  sumbal=0;
  while (memcmp(kod1,"***",3)!=0)
    {
  memset(Sadi1,'\0',20); memset(Tadi1,'\0',20);memset(Il1,'\0',20);memset(kod1,'\0',11);
  printf("\n kod=");scanf(" %s",&amp;kod1);
  if(kod1[0]=='*') break;
  printf("\n Sadi=");scanf(" %s",&amp;Sadi1);
  printf("\n Tadi=");scanf("%s",&amp;Tadi1);
  printf("\n Anadan oldugu il=");scanf("%s",&amp;Il1);
  printf("\n ehaqqi=");scanf("%f",&amp;ehaqqi1);
  memcpy(s[i].kod,kod1,11);
  memcpy(s[i].Sadi,Sadi1,20);
  memcpy(s[i].Tadi,Tadi1,20);
  memcpy(s[i].Il,Il1,20);
  s[i].ehaqqi=ehaqqi1;

  sumbal+=s[i].ehaqqi;
  printf("\n %s %s %s %s %9.2f",kod1,Sadi1,Tadi1,Il1,ehaqqi1);

  i++;
    }
  k=i-1;
  return 0;
  }
//************************************************************************
nizam()
   {
     int m,i,j,kl;
     foxuma();
     m=k;
     printf("\n 1-nizamlama koda gore                    ");
     printf("\n 2-nizamlama Sadina gore                    ");
     printf("\n 3-nizamlama ehaqqinin azalma istiqametinde  ");
     printf("\n 4-nizamlama ehaqqinin artma istiqametinde   ");
     scanf("%d",&amp;kl);
     for (i=0;i&lt;k;i++)
      {
       for (j=0;j&lt;m;j++)
    {
       if(kl==4&amp;&amp;s[j].ehaqqi&gt;s[j+1].ehaqqi)
       {ehaqqi1=s[j+1].ehaqqi;s[j+1].ehaqqi=s[j].ehaqqi;s[j].ehaqqi=ehaqqi1;
  memcpy(Sadi1,s[j+1].Sadi,20);memcpy(s[j+1].Sadi,s[j].Sadi,20);
  memcpy(s[j].Sadi,Sadi1,20);
  memcpy(Tadi1,s[j+1].Tadi,20);memcpy(s[j+1].Tadi,s[j].Tadi,20);
  memcpy(s[j].Tadi,Tadi1,20);
  memcpy(Il1,s[j+1].Il,20);memcpy(s[j+1].Il,s[j].Il,20);
  memcpy(s[j].Il,Il1,20);
  memcpy(kod1,s[j+1].kod,11);memcpy(s[j+1].kod,s[j].kod,11);
  memcpy(s[j].kod,kod1,11);
      }
    if(kl==3&amp;&amp;s[j].ehaqqi&lt;s[j+1].ehaqqi)
     {ehaqqi1=s[j+1].ehaqqi;s[j+1].ehaqqi=s[j].ehaqqi;s[j].ehaqqi=ehaqqi1;
  memcpy(Sadi1,s[j+1].Sadi,20);memcpy(s[j+1].Sadi,s[j].Sadi,20);
  memcpy(s[j].Sadi,Sadi1,20);
  memcpy(Tadi1,s[j+1].Tadi,20);memcpy(s[j+1].Tadi,s[j].Tadi,20);
  memcpy(s[j].Tadi,Tadi1,20);
  memcpy(Il1,s[j+1].Il,20);memcpy(s[j+1].Il,s[j].Il,20);
  memcpy(s[j].Il,Il1,20);
  memcpy(kod1,s[j+1].kod,11);memcpy(s[j+1].kod,s[j].kod,11);
  memcpy(s[j].kod,kod1,11);
      }
     if (kl==2&amp;&amp;memcmp(s[j].Sadi,s[j+1].Sadi,15)&gt;0)
      {ehaqqi1=s[j+1].ehaqqi;s[j+1].ehaqqi=s[j].ehaqqi;s[j].ehaqqi=ehaqqi1;
  memcpy(Sadi1,s[j+1].Sadi,20);memcpy(s[j+1].Sadi,s[j].Sadi,20);
  memcpy(s[j].Sadi,Sadi1,20);
  memcpy(Tadi1,s[j+1].Tadi,20);memcpy(s[j+1].Tadi,s[j].Tadi,20);
  memcpy(s[j].Tadi,Tadi1,20);
  memcpy(Il1,s[j+1].Il,20);memcpy(s[j+1].Il,s[j].Il,20);
  memcpy(s[j].Il,Il1,20);
  memcpy(kod1,s[j+1].kod,11);memcpy(s[j+1].kod,s[j].kod,11);
  memcpy(s[j].kod,kod1,11);
      }
      if (kl==1&amp;&amp;memcmp(s[j].kod,s[j+1].kod,10)&gt;0)
      {ehaqqi1=s[j+1].ehaqqi;s[j+1].ehaqqi=s[j].ehaqqi;s[j].ehaqqi=ehaqqi1;
  memcpy(Sadi1,s[j+1].Sadi,20);memcpy(s[j+1].Sadi,s[j].Sadi,20);
  memcpy(s[j].Sadi,Sadi1,20);
  memcpy(Tadi1,s[j+1].Tadi,20);memcpy(s[j+1].Tadi,s[j].Tadi,20);
  memcpy(s[j].Tadi,Tadi1,20);
  memcpy(Il1,s[j+1].Il,20);memcpy(s[j+1].Il,s[j].Il,20);
  memcpy(s[j].Il,Il1,20);
  memcpy(kod1,s[j+1].kod,11);memcpy(s[j+1].kod,s[j].kod,11);
  memcpy(s[j].kod,kod1,11);
      }

         }
       m=m-1;
      }
     ekran();

     return 0;
    }
//***********************************************************************

  fayldavam()
  {
   FILE *ff;
    ff=fopen("D:bal","a+");
   for (i=0;i&lt;=k;i++)
    {
     fprintf(ff,"\n %s %s %s %s %f",s[i].kod,s[i].Sadi,s[i].Tadi,s[i].Il,s[i].ehaqqi);
    }
   fclose(ff);
   return 0;
  }
//**************************************************************************
  silme()
   {
    char ud[20];int ks;
    ud[0]='a';
    foxuma();
    printf("\n koda gore silme=1,Seherin adina gore silme=2\n");
    scanf("%d",&amp;ks);
    while(memcmp(ud,"***",3)!=0)
      {
      if (ks==1)
    {printf("\n silinen yazi kodu=   ");scanf("%s",&amp;ud);}
       if(ks==2)
    {printf("\n silinen yazinin soyadi= ");scanf("%s",&amp;ud);}
       for (i=0;i&lt;=k;i++)
     {
      if (ks==1&amp;&amp;memicmp(s[i].kod,ud,strlen(ud))==0) {memcpy(s[i].kod,"uuu",3); break;}
      if (ks==2&amp;&amp;memicmp(s[i].Sadi,ud,strlen(ud))==0) {memcpy(s[i].kod,"uuu",3); break;}
     }
       }
    yenifayl2();
    foxuma();
    ekran();
    return 0;
   }
//**************************************************************************
   foxuma()
    {
     FILE *ff;
     ff=fopen("D:bal","r");
     sumbal=0;
     for (i=0;i&lt;=100;i++)
       {
    fscanf(ff,"\n %s %s %s %s %f",s[i].kod,s[i].Sadi,s[i].Tadi,s[i].Il,&amp;s[i].ehaqqi);
    sumbal+=s[i].ehaqqi;
    if (feof(ff)) break;

       }
     k=i;
     fclose(ff);
     return 0;
    }
//**************************************************************************
  yenifayl2()
   {
    int k1=0;
    FILE *ff;
    ff=fopen("D:bal","w");
    for (i=0;i&lt;=k;i++)
     if (memicmp(s[i].kod,"uuu",3)!=0)
      {
    fprintf(ff,"\n %s %s %s %s %f",s[i].kod,s[i].Sadi,s[i].Tadi,s[i].Il,s[i].ehaqqi);
    k1++;
       }
   fclose(ff);
   k=k1-1;
   return 0;
   }
//**************************************************************************
    yenifayl()
    {
      FILE *ff;
      ff=fopen("D:bal","w");
      for (i=0;i&lt;=k;i++)

       {
     fprintf(ff,"\n %s %s %s %s %f",s[i].kod,s[i].Sadi,s[i].Tadi,s[i].Il,s[i].ehaqqi);
       }
      fclose(ff);
      return 0;
    }
//***************************************************************************
</code></pre>
