1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C language problem ?

  1. Jun 2, 2009 #1
    1. The problem statement, all variables and given/known data

    1Can we perform arithmetic operations between float and int variables ,
    As an example can we say a+b while a is an integer and b is a float.

    2 And what function below will read NUMBER of elements from a file?
    fileread( )
    getline( )
    readfile( )
    fread( )


    2. Relevant equations



    3. The attempt at a solution
     
  2. jcsd
  3. Jun 2, 2009 #2

    Borek

    User Avatar

    Staff: Mentor

    Yes. Look for type promotion.

    C? stdio.h?
     
  4. Jun 2, 2009 #3
    stdio.h header file is there !!!! i want to know what function will read number of elements from file ?/
     
  5. Jun 2, 2009 #4

    Borek

    User Avatar

    Staff: Mentor

    read can do it. Trick is, you are listing functions that as far as I remember are not present neither in io.h nor stdio.h, so I have no idea what you refer to.
     
  6. Jun 2, 2009 #5

    sylas

    User Avatar
    Science Advisor

    Two of them are in stdio.h, and one of them is for reading a given number of elements from a FILE stream.
     
  7. Jun 2, 2009 #6

    Borek

    User Avatar

    Staff: Mentor

    Yes, two are present - but two are not.
     
  8. Jun 2, 2009 #7

    sylas

    User Avatar
    Science Advisor

    I think it must be a simple multichoice quiz question with two dummy functions that sound plausible and don't exist, and two real functions... only one of which does what is asked.
     
  9. Jun 2, 2009 #8

    Borek

    User Avatar

    Staff: Mentor

    To some extent that's what I supposed at first, but - as such functions do exist in some languages/libraries - I wasn't sure what the question really is about; hence my attempt at clarificatin of the situation.
     
  10. Jun 2, 2009 #9

    sylas

    User Avatar
    Science Advisor

    Use grep, egrep or fgrep to look for definitions of those four functions in stdio.h. You should be able to figure it from there.
     
  11. Jun 2, 2009 #10
    Yr exactly .....it is the case Its a MCQ .So what will be the answer help please .
     
  12. Jun 2, 2009 #11

    sylas

    User Avatar
    Science Advisor

    Before there was google, there was grep to answer everything... :wink:

    grep stdio.h for the function definitions... or use man
     
  13. Jun 2, 2009 #12
    You have mentioned that two functions here exist and others do not .so please tell me which one exists.
     
  14. Jun 2, 2009 #13

    Borek

    User Avatar

    Staff: Mentor

    Use grep or any other tool to check the content of stdio.h and io.h, we will not spoonfeed you.
     
  15. Jun 2, 2009 #14
    oh thanks so much for ur VALUABLE advice !!!!!!!it was a great help!!!!!!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: C language problem ?
  1. C language (Replies: 6)

  2. C language (Replies: 5)

Loading...