C language problem ?

  • Thread starter rclakmal
  • Start date
  • #1
76
0

Homework Statement



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


Homework Equations





The Attempt at a Solution

 

Answers and Replies

  • #2
Borek
Mentor
28,507
2,935
As an example can we say a+b while a is an integer and b is a float.
Yes. Look for type promotion.

fileread( )
getline( )
readfile( )
fread( )
C? stdio.h?
 
  • #3
76
0
stdio.h header file is there !!!! i want to know what function will read number of elements from file ?/
 
  • #4
Borek
Mentor
28,507
2,935
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.
 
  • #5
sylas
Science Advisor
1,646
7
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.
Two of them are in stdio.h, and one of them is for reading a given number of elements from a FILE stream.
 
  • #6
Borek
Mentor
28,507
2,935
Yes, two are present - but two are not.
 
  • #7
sylas
Science Advisor
1,646
7
Yes, two are present - but two are not.
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.
 
  • #8
Borek
Mentor
28,507
2,935
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.
 
  • #9
sylas
Science Advisor
1,646
7
stdio.h header file is there !!!! i want to know what function will read number of elements from file ?/
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.
 
  • #10
76
0
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.
Yr exactly .....it is the case Its a MCQ .So what will be the answer help please .
 
  • #11
sylas
Science Advisor
1,646
7
Yr exactly .....it is the case Its a MCQ .So what will be the answer help please .
Before there was google, there was grep to answer everything... :wink:

grep stdio.h for the function definitions... or use man
 
  • #12
76
0
You have mentioned that two functions here exist and others do not .so please tell me which one exists.
 
  • #13
Borek
Mentor
28,507
2,935
Use grep or any other tool to check the content of stdio.h and io.h, we will not spoonfeed you.
 
  • #14
76
0
oh thanks so much for ur VALUABLE advice !!!!!!!it was a great help!!!!!!
 

Related Threads on C language problem ?

  • Last Post
Replies
5
Views
1K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
3
Views
9K
  • Last Post
Replies
1
Views
2K
Replies
0
Views
954
  • Last Post
Replies
1
Views
4K
  • Last Post
Replies
1
Views
833
  • Last Post
Replies
1
Views
830
Replies
8
Views
533
Replies
10
Views
838
Top