实用技巧之while里面使用getchar或sleep函数

                                   我们经常需要打印一些变量的取值来调试程序,使用while(1)是常用的手段。

                                  

              while (1)
        {
            char letter = getchar();
            printf("test_point is %d \t\n", test_point);
            printf("test_point is %f \t\n", test_point);
            //printf("右移一些位数%d \t\n", (test_point & 0xff00) >> 16);
            //printf("hello world\n");
            //scanf("%d", &normal_point);
            printf(" letter is %c\n", letter);
        }




                 while (1)
        {
        
            printf("test_point is %d \t\n", test_point);
            printf("test_point is %f \t\n", test_point);
            Sleep(1000);
        }

                                    

猜你喜欢

转载自www.cnblogs.com/nowroot/p/12363212.html
今日推荐