Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. c / c++

Category: c / c++

c
c / c++ July 19, 2008 1 min read by mkyong 8 comments

Calculate program execute time / time elapsed in C

Here i shared a simple method to calculate program execute time or time elapsed in C /*calculate program execute time */ #include #include int main(int argc, char *argv[]) { time_t start, stop; clock_t ticks; long count; time(&start); // Do stuff int i=0; while(i

Read more Calculate program execute time / time elapsed in C
c
c / c++ July 17, 2008 2 min read by mkyong 13 comments

How to handle unknow size user input in C

Here are two examples to handle user input in C. 1. scanf This method is easy get attack by buffer overflow, try input some characters which are more than what you declare to experience about what is buffer overflow. #include #include int main() { char bStr[80]; printf(“\nEnter a very very very long String value:”); scanf(“%s”, […]

Read more How to handle unknow size user input in C

Java and Spring tutorials since 2008. Every example is a complete, runnable file, compiled and run on a real machine before it goes out.

About This Site

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use

© 2026 mkyong.com — Powered by WordPress

RSS