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 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 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

Mkyong.com has provided Java and Spring tutorials, guides, and code snippets since 2008. All published articles are simple, easy to understand, and well-tested in our development environment.

Mkyong.com licenses all source code on this website under the MIT License.

About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
Tools
  • Spring Framework
  • Quarkus Framework
  • Micronaut Framework
  • Oracle Java JDK
  • Eclipse Temurin JDK
  • OpenJDK JDK
  • Hibernate ORM
  • Maven Build Tool
  • Gradle Build Tool
  • Tomcat Application Server
  • Docker
Links
  • Maven Central
  • Docker Hub
  • Spring Guides
  • Quarkus Guides
  • Micronaut Guides
  • Martin Fowler
  • AskPython

© 2026 mkyong.com — Powered by WordPress

RSS