简体   繁体   中英

getting “void value not ignored as it ought to be” in C

I started learning C in class and have started the assignment but I'm writing it one piece at a time. Currently I'm stuck because I may be doing something completely wrong but I don't know what I'm doing.

The error is pretty clear... The void type isn't something you can return / store in a variable. Instead it's a special type that means "nothing". You can't store nothing, you must ignore the return or return something.

displayCard only displays the cards, it does nothing to define them, so you shouldn't be trying to use it to create your cards. Instead, think about what a "card" actually is in your program--what, for example, do you have to pass to displayCard in order for it to know which card to display?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM