Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Mohamed Nehad

@Mohamed Nehad
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Define 'Enter' key in C
    M Mohamed Nehad

    Both programs debug well ! :/

    C / C++ / MFC question

  • How to break an infinite loop
    M Mohamed Nehad

    If i made a program which prints on the screen " Mike " infinite times without stop . how can i define a certain key if i pressed the program stop printing ? ====== I use ' getch() ' method but the program had to stop and check my entry and this isn't my question here.

    C / C++ / MFC question tutorial

  • Define 'Enter' key in C
    M Mohamed Nehad

    How can i define the enter key to stop a working loop in my program ? for advance .. 2-programs here which enter key defined both with different ways ! ==============

    #include
    #include
    #include

    int main()
    {

    int x=1;
    r:
        printf("Allah  %d\\n", x);
        x++;
        while ( getch() != '\\r')
        {
            goto r;
        }
        return 0;
    

    }

    and the other one ..

    #include
    #include
    #include

    int main()
    {
    int nm = 0, ch = 0, wr = 1,i=0;
    char x;

    while ((x=getchar()) != '\\n')
    {
    	if (isdigit(x))
    	{
    		nm++;
    	}
    	else if (isalpha(x))
    	{
    		ch++;
    	}
    	else if (x == ' ')
    	{
    		wr++;
    	}
    	i++;
    }
    printf(" \\n");
    
    printf("Numbers entered = %d , Characters entered = %d , Words entered = %d", nm, ch, wr);
    printf(" \\n");
    system("pause");
    return 0;
    

    }

    The first one enter was defined as '\r' while the second was '\n' ! which is the right way ?!

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups