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

Recent Posts

  • Java Compact Source File: No Class, No Static Main
  • Java Scoped Values Example
  • Spring Boot RAG Example with Spring AI
  • Java AtomicInteger Example
  • Java Virtual Threads Example
  • Spring Boot Supabase CRUD Example
  • Spring Boot REST Docs Example
  • How to Install Java on Windows (Step-by-Step Guide)

© 2008–2026 mkyong.com

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