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

  • SEARCH
  • Home
  • 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 6243637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:10:37+00:00 2026-05-24T12:10:37+00:00

Whenever we call a function returning value why it is not required to catch

  • 0

Whenever we call a function returning value why it is not required to catch the value?
consider the following C code,

int main()
{
      int i;
      scanf("%d",&i);
      printf("Value of i is: ",i);
      return 0;
}

Here scanf() returns value 1, but as it is not catched in anywhere why didn’t the error pops up?
What is the reason to allow such programming?

  • 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-24T12:10:38+00:00Added an answer on May 24, 2026 at 12:10 pm

    Primarily because expressions in C also yield values. For example: x = 1; yields the value 1. Sometimes you use that for multiple assignment like x = y = 1;, but more often you don’t.

    In early C, the void return type hadn’t been invented either, so every function returned some value, whether it was generally useful or not (for example, your call to printf also returns a value).

    The rules of the language don’t make this an error (doing so would lose compatibility with virtually existing code) and since this is common and rarely indicates a problem, most compilers don’t warning about it either. A few lint tools do, which has led a few misguided programmers to write things like (void)printf("whatever"); (i.e., casting the unused return to void to signal that it really, truly was intentional when it was ignored. This, however, rarely does any good, and frequently does quite a bit of harm, so (thankfully) it’s rarely seen.

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

Sidebar

Related Questions

right now whenever i call this function the value in B3 cell of excel
can i save the returning value of eval function in a variable and use
Suppose i have one simple function in my program. Whenever i call that function
On my 8-bit Freescale HCS08 micro, whenever I call a library function that returns
I intend to call a function whenever m_logger<<hello<<world is called. m_logger is of type
If I have a function that takes int *& , what does it means?
I'm using the following ajax function: function callAjax(request,callback) { if (window.XMLHttpRequest) {// code for
I am trying to do the following: call a function which takes references as
I have this code & I've tired using JQuery's appendTo() function to get this
I need to call function whenever class is created using new. Currently I need

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.