#Could anyone explain why I am getting this warning?

35 messages · Page 1 of 1 (latest)

waxen palm
#

warning: too many arguments for format [-Wformat-extra-args]
| printf("\nLarger numbers generated from &d: *", originalnumber);

strange heathBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

waxen palm
#

Line 77

white wolf
#

I think you meant to write %d rather than &d there

meager hill
#

also this screenshot is microscopic and barely readable

#

!code

strange heathBOT
#
How to Format Code on Discord
Markup

```c
int main() {}
```

Result
int main() {}
spare silo
waxen palm
#

sorry

waxen palm
#

/tmp/ccVxbk1N.o: In function generatenumbers': | /mnt/vocwork4/grader/eee_G_2733186/asn2703992_14/asn2703993_1/1781161/4/work/hw05.c:69: undefined reference to generaterandom'
| collect2: error: ld returned 1 exit status

#

do yall understand this error?

spare silo
#

you didn't define generaterandom

white wolf
#

it's saying it can't find the definition for that function

waxen palm
#

does this mean i need to put it before?

#

i currently have the generate random after the function that calls it

#

or uses it

white wolf
#

the case matters, generaterandom is not the same as generateRandom

waxen palm
#

wow im stupid

#

is this telling me i need to write

#

return rand() & (max-min+1) (+) min;

spare silo
#

you don't want & there

#

it's not gonna do what you want

waxen palm
#

how would i write it then?

spare silo
#

%

waxen palm
#

oh

#

wow

#

im slow

spare silo
#

& is bitwise and

waxen palm
#

i always get the % and & mixed

waxen palm
#

for this error, i want it to reprint the "enter desired minimum value" and "enter desired maximum value" after the error

#

should i just copy the while thing at the top and replace the if below?>