It's about the prototype declaration of the c language.

Asked 2 months ago, Updated 2 months ago, 3 views

I recently started learning the program.

#include<stdio.h>
# include <handy.h>

void humanA();

int main() {
    humanA();
    HgGetChar();
    HgClose();
    return 0;
}

void humanA() {
    HgCircle (300, 75, 25);
    HgLine (300, 50, 300, 25);
    HgLine (275, 38, 325, 38);
    HgLine (275, 38, 275, 25);
    HgLine (325, 38, 325, 50);
    HgLine (300, 25, 275, 0);
    HgLine (300, 25, 325, 25);
    HgLine (325, 25, 325, 0);
}

I'd like to make a prototype declaration and display it like this.
Warning is coming out.Please tell me what's wrong.

c

2022-09-30 11:17

1 Answers

void humanA(); is interpreted as a "function declaration that is not a prototype declaration" if specification, so it matches.)

In , void humanA(); is the same argument declaration as the empty function of the argument.Item="View questions tagged with 'c++'">c++ behave differently.

For gcc, specifying -Wstrict-prototypes displays three warnings for the proposed source code: warning:function decoding isn'ta protocol.


2022-09-30 11:17

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.