Language: C

#include<stdio.h>
    
</stdio.h>
typedef struct vec vec;

struct vec {
    double x, y;
};



/* 便利なコンストラクタ関数*/
static vec P(double x, double y) {
    vec p = {x, y};
    return p;
}

static vec add(vec a,vec b){
    return Vec(a.x + b.y, a.y + b.y);
    }
    
static vec add(vec a,vec b){
    return Vec(a.x - b.y, a.y - b.y);
    }

static double norm(vec a){
    return sqrt(a.x * b.y, a.y * b.x);
    }

static double dot(vec a,vec b){
    return a.x * b.y - a.y * b.x;
    }


int main(void){
    vec a　= {1.0,2.0};
    vec b = Vec{2.0,3.0};
    vec c = add(a,b);
    printf("(%f,%f)\n", c.x, c.y);
    printf("dot %f\n",dot(a , b));
    printf("cross %f\n", cross(a,b));
    
    
    return 0;
    }





Compiler output:
main.c:3:1: error: expected identifier or '(' before '<' token
    3 | </stdio.h>
      | ^
main.c:13:8: error: unknown type name 'vec'
   13 | static vec P(double x, double y) {
      |        ^~~
main.c: In function 'P':
main.c:14:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
   14 |     vec p = {x, y};
      |     ^~~
      |     struct 
main.c:14:17: warning: excess elements in scalar initializer
   14 |     vec p = {x, y};
      |                 ^
main.c:14:17: note: (near initialization for 'p')
main.c: At top level:
main.c:18:8: error: unknown type name 'vec'
   18 | static vec add(vec a,vec b){
      |        ^~~
main.c:18:16: error: unknown type name 'vec'
   18 | static vec add(vec a,vec b){
      |                ^~~
main.c:18:22: error: unknown type name 'vec'
   18 | static vec add(vec a,vec b){
      |                      ^~~
main.c:22:8: error: unknown type name 'vec'
   22 | static vec add(vec a,vec b){
      |        ^~~
main.c:22:16: error: unknown type name 'vec'
   22 | static vec add(vec a,vec b){
      |                ^~~
main.c:22:22: error: unknown type name 'vec'
   22 | static vec add(vec a,vec b){
      |                      ^~~
main.c:26:20: error: unknown type name 'vec'
   26 | static double norm(vec a){
      |                    ^~~
main.c:30:19: error: unknown type name 'vec'
   30 | static double dot(vec a,vec b){
      |                   ^~~
main.c:30:25: error: unknown type name 'vec'
   30 | static double dot(vec a,vec b){
      |                         ^~~
main.c: In function 'main':
main.c:36:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
   36 |     vec a　= {1.0,2.0};
      |     ^~~
      |     struct 
main.c:36:10: error: stray '\343' in program
   36 |     vec a<U+3000>= {1.0,2.0};
      |          ^~~~~~~~
main.c:36:19: warning: excess elements in scalar initializer
   36 |     vec a　= {1.0,2.0};
      |                   ^~~
main.c:36:19: note: (near initialization for 'a')
main.c:37:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
   37 |     vec b = Vec{2.0,3.0};
      |     ^~~
      |     struct 
main.c:37:13: error: 'Vec' undeclared (first use in this function); did you mean 'vec'?
   37 |     vec b = Vec{2.0,3.0};
      |             ^~~
      |             vec
main.c:37:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:16: error: expected ',' or ';' before '{' token
   37 |     vec b = Vec{2.0,3.0};
      |                ^
main.c:38:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
   38 |     vec c = add(a,b);
      |     ^~~
      |     struct 
main.c:38:13: error: implicit declaration of function 'add' [-Wimplicit-function-declaration]
   38 |     vec c = add(a,b);
      |             ^~~
main.c:39:26: error: request for member 'x' in something not a structure or union
   39 |     printf("(%f,%f)\n", c.x, c.y);
      |                          ^
main.c:39:31: error: request for member 'y' in something not a structure or union
   39 |     printf("(%f,%f)\n", c.x, c.y);
      |                               ^
main.c:40:23: error: implicit declaration of function 'dot' [-Wimplicit-function-declaration]
   40 |     printf("dot %f\n",dot(a , b));
      |                       ^~~
main.c:41:26: error: implicit declaration of function 'cross' [-Wimplicit-function-declaration]
   41 |     printf("cross %f\n", cross(a,b));
      |                          ^~~~~