Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 303157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:09:47+00:00 2026-05-12T07:09:47+00:00

I am currently learning and experimenting with C and am using Bloodshed’s DEV-C++ as

  • 0

I am currently learning and experimenting with C and am using Bloodshed’s DEV-C++ as an IDE.

Now, I just realized that the following piece of code (as it is…no includes or nothing) compiles and runs :

main ()
{
    printf("%d", strlen("hello"));  
}

Now, if I’m not mistaken, shouldn’t two header files be included in this source for it to work ? stdio.h and string.h…but as you can see, I did not add them and the code still compiled and ran successfully.

My complaint is that I want the compiler to be “strict” because since I’m still learning C, I don’t want the code to run if normally it shouldn’t.

So, is there any way to prevent Dev-C++ from ‘correcting my mistakes’ when it comes to includes, ie making it more kinda “strict” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:09:47+00:00Added an answer on May 12, 2026 at 7:09 am

    C90 had a feature (absent of C99 and C++) called implicit function declaration: when you used a name not declared yet in a function call, the compiler behaved as if

    extern int identifier();
    

    had been seen. That feature has been dropped from C99 and most compilers had option to warn about this even before C99 was promulgated.

    Even when staying in C90, it is not recommended style to use this. If you have to maintain code making use of this and can’t add prototypes, check that:

    • the functions returns an int (it is the case for printf but the validity is implementation dependent for strlen which returns a size_t which can be int or something else)

    • the function isn’t variadic (it is the case for strlen but not printf)

    • the type of the arguments is not modified by default argument promotions (char, short, float are) and you must pay attention to cast pointers to void* when needed when the expected type is void*, you have to pay attention to cast NULL to the correct pointer type. (These are the same things you have to pay attention for variadic arguments BTW).

    If those conditions aren’t met — and they aren’t for any calls in your code — you enter in the realm of undefined behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 236k
  • Answers 236k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The linker plays an essential role in C/C++ building to… May 13, 2026 at 6:19 am
  • Editorial Team
    Editorial Team added an answer Well there's two I know of: The OpenInkPot Linux distribution… May 13, 2026 at 6:19 am
  • Editorial Team
    Editorial Team added an answer From the docs: Create Trigger Syntax trigger_stmt is the statement… May 13, 2026 at 6:19 am

Related Questions

I am currently learning and experimenting with C and am using Bloodshed's DEV-C++ as
I know the topic I started is too subjective. But I just wanted some
I am currently learning ironpython and loving but i'm looking to move on from
So I am currently learning C++ and decided to make a program that tests
I have experience in client-server application development in C/C++ on Windows platform. I would

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.