Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following code: #defined HEADS 0 #incliude some_library.h char * Flip_A_Coin(int x) { if (x%2 == HEADS) return(heads); else return(tails); } main( ) {

Consider the following code:
#defined HEADS 0
#incliude "some_library.h"
char * Flip_A_Coin(int x)
{
if (x%2 == HEADS)
return("heads");
else
return("tails");
}
main( )
{
printf("%s\n", Flip_A_Coin(1));
}

Assume that this code is stored in a file named coin2.c andcomplied as follows:
ahoover@video> gcc -o coin2 coin2.c

(a)What sort of error might you expect to see?
(b)On what situation does this error depend??
(c)At what stage of building the program does this erroroccur??

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Structures and Algorithms in Java

Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

6th edition

1118771334, 1118771338, 978-1118771334

More Books

Students also viewed these Databases questions

Question

=+a) Whether to invest in solar energy companies.

Answered: 1 week ago

Question

Give a complete justification of Proposition 12.1.

Answered: 1 week ago

Question

c. What did the listeners observe about the speakers?

Answered: 1 week ago

Question

3. To examine common concerns regarding being in group situations?

Answered: 1 week ago