#Cannot Assign return value to Token struct

21 messages · Page 1 of 1 (latest)

wheat sigil
#

I want to assign the variable token of the Token struct a value which it gets from the function which also returns a token, but vs code tells me that its an int?

raw shadowBOT
#

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.

hollow rune
#

Show us the declaration of get_next_token()

raw shadowBOT
# arctic maple !sc

@wheat sigil

Monke
Please Do Not Send Screenshots or Photos!

They're hard to read and prevent copying and pasting.

arctic maple
#

Also what is Token?

wheat sigil
#

hang on ill send the code

hollow rune
#

I'm gonna take a wild guess that you didn't include the header that has the function definition/the function isn't defined so it just assumed it's an extern returning int yamikek

#

Or something like this

arctic maple
hollow rune
#

iirc that's a thing in C

hollow rune
arctic maple
#

Yeah, that's literally his mistake

#

🐒

hollow rune
#

Because the function they call doesn't exist the compiler assumed it returns int

hollow rune
#

Op fyi

#

If you call a function that isn't declared, the compiler will assume it's a function that returns int

wheat sigil
#

!solved