Why for is a keyword but printf is not?

Debojit Acharjee 455 Reputation points
2023-05-30T14:08:42.57+00:00

If for is a function like prinft() then why printf() is not a keyword?

If 32 keywords are a part of the standard C library then why not printf() because printf() is a part of the header file stdio.h.

Developer technologies | C++
Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,161 Reputation points Volunteer Moderator
    2023-05-30T15:06:56.9933333+00:00

    for is not a function. It is a statement. Being a keyword is how the parser know this.

    printf is a function and not part of the language, only the standard library.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.