Results 1 to 8 of 8

Thread: / .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jan:2010
    Location:
    Posts: 116

    / .

    ,
    4 ( ), 2 ( ), ( if/while/do/int .. )... , , . . .

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <windows.h>
    #include <conio.h>
    // Functions prototypes
    void fcase1(char *,char *, int);
    int fLinesCount(char fname[],int count);
    int fSearchChar(char fname[],char ch,int count);
    //int fRead(char fname[],char ch,int count);
    int main()
    {
        char exit;
     do
     {  FILE *fou;
        int choise,count=0;
        char ch;
        char fin[30];
        char fout[30];
    
    SetConsoleOutputCP(1251);
    
    // Menu Start
     // Coloring Start
        HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );
        WORD wOldColorAttrs;
        CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
    
        GetConsoleScreenBufferInfo(h, &csbiInfo);
        wOldColorAttrs = csbiInfo.wAttributes;
     // Coloring End
    
    SetConsoleTextAttribute ( h, FOREGROUND_GREEN | FOREGROUND_INTENSITY );
    
    printf("////////////////////////////////////////////////////////////////////////////////");
    printf("//");
    printf("                         &#202;&#243;&#240;&#241;&#238;&#226;&#224; &#208;&#224;&#225;&#238;&#242;&#224; &#239;&#238; &#207;&#200;&#202; I ");
    printf("                           //");
    printf("//");
    printf("     ... 54&#225;, &#237;&#238;&#236;&#229;&#240; 111213205");
    printf("   //");
    printf("//");
    printf("                                                                            //");
    printf("//");
    printf("&#204;&#238;&#235;&#255; &#232;&#231;&#225;&#229;&#240;&#229;&#242;&#229; &#238;&#239;&#246;&#232;&#255; &#238;&#242; &#236;&#229;&#237;&#254;&#242;&#238;.");
    printf("                                              //");
    printf("//");
    printf("                                                                            //");
    printf("//");
    printf("1.    /    . ");
    printf("                  //");
    printf("//");
    printf("2.       .");
    printf("             //");
    printf("//");
    printf("3.         ");
    printf("               //");
    printf("//");
    printf("4.         .");
    printf("    //");
    printf("//");
    printf("                                                                            //");
    printf("////////////////////////////////////////////////////////////////////////////////");
    printf(":: ");
    fflush(stdin);
    scanf("%i",&choise);
    
    SetConsoleTextAttribute ( h, wOldColorAttrs);
    // Menu End
    
    // Switch start
        switch (choise)
        {
        case 1:
         {
             
             void fcase1(fin,fout,count);
             
    /*         printf("     : ");
              fflush(stdin);
             scanf("%s",fin);
    
            printf("     : ");
              fflush(stdin);
             scanf("%s",fout);
              fflush(stdin);
    
            fou=fopen(fout,"w");
            if(fou==NULL)
                fprintf(fou,"File can't be open!");
            else
               {
                fprintf(fou,"    - %d",fLinesCount(fin,count));
                fclose(fou);
               }
               */
         }
            break;
    
        case 2:
         
        case 3:
    
        case 4:
    
        default:
            printf(" ");
            break;
        }
    // Switch end
    
    //  /
     fflush(stdin);
     printf("\n   ? [y/n]");
     fflush(stdin);
     scanf("%c",&exit);
     system("cls");
    
     }
    while(exit!='y');
    
        return 0;
    
    }
    
    // Definition of Functions
    
    int fLinesCount(char fin[],int count)
    {
       unsigned int lines_count = 0;
        FILE *fp = fopen(fin, "r");
        int ch;
    
        while ((ch=getc(fp))!=EOF  )
            if ( ch == '\n')
                ++lines_count;
        fclose(fp);
        return lines_count;
    }
    
    void fcase1(char fin[],char fout[], int count)
    {
        FILE *fou;
        int v;
            printf("    : ");
             fflush(stdin);
            scanf("%s",fin);
    
            printf("    : ");
              fflush(stdin);
            scanf("%s",fout);
              fflush(stdin);
    
            fou=fopen(fout,"w");
            if(fou==NULL)
                fprintf(fou,"File can't be open!");
            else
            {
                v=fLinesCount(fin,count);
                fprintf(fou,"&#193;&#240;&#238;&#255; &#237;&#224; &#240;&#229;&#228;&#238;&#226;&#229;&#242;&#229; &#229; - %d",v);
            }
                fclose(fou);
    }
    : case 1: ( , )

    2: ...
    Last edited by Tony.Jelev; 25th December 2013 at 01:23. Reason: ... ...

  2. #2
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Code:
    void fcase1(fin,fout,count);
    "void"; ( ), .
    (10b) || !(10b)

  3. #3
    Registered User
    Join Date: Jan:2010
    Location:
    Posts: 116
    1 ... :/ ,

  4. #4
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    , .
    Code:
    int main()
    {
         func1();
    }
    
    void func1()
    {
         func2();
    }
    
    void func2()
    {
    }
    (10b) || !(10b)

  5. #5
    Registered User
    Join Date: Jan:2010
    Location:
    Posts: 116
    , . :/ . void func1() ?
    Code:
    void func1(int something, float something)
    {
     func2();
    }

  6. #6
    Registered User
    Join Date: Jan:2012
    Location: Varna
    Posts: 58
    func1 :
    Code:
    void func1(int something, float something)
    {
     func2();
    }
    func1 :
    Code:
    int intVar;
    float floatVar;
    func1(intVar, floatVar);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |