0

-fpermissive Error

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <stdbool.h> struct Geometry { bool isrectangle, isquare, isline, iscircle; float x1, x2, y1, y2; float square_corner1, square_corner2, side; float center1, center2, radius; float rectangle_corner1, rectangle_corner2, width, height; }; void initRectangle(struct Geometry **object) { scanf("%f %f %f %f", &((*object)->rectangle_corner1), &((*object)->rectangle_corner2), &((*object)->width), &((*object)->height)); (*object)->isrectangle = true; (*object)->iscircle = false; (*object)->isquare = false; (*object)->isline = false; }; void initSquare(struct Geometry **object) { scanf("%f %f %f", &((*object)->square_corner1), &((*object)->square_corner2), &((*object)->side)); (*object)->isrectangle = false; (*object)->iscircle = false; (*object)->isquare = true; (*object)->isline = false; }; void initCircle(struct Geometry **object) { scanf("%f %f %f", &((*object)->center1), &((*object)->center2), &((*object)->radius)); (*object)->isrectangle = false; (*object)->iscircle = true; (*object)->isquare = false; (*object)->isline = false; }; void initLine(struct Geometry **object) { scanf("%f %f %f %f", &((*object)->x1), &((*object)->x2), &((*object)->y1), &((*object)->y2)); (*object)->isrectangle = false; (*object)->iscircle = false; (*object)->isquare = false; (*object)->isline = true; }; void printGeometry(struct Geometry* object) { if (object->iscircle == true){ printf("Circle with center at %f, %f and radius %f\n", object->center1, object->center2, object->radius); } else if (object->isline == true){ printf("Line from (%f, %f) to (%f, %f)\n", object->x1, object->x2, object->y1, object->y2); } else if (object->isquare == true){ printf("Square with corner at (%f, %f) and side %f\n", object->square_corner1, object->square_corner2, object->side); }

19th Oct 2022, 1:59 AM
Mayur Patil
1 Answer
0
In C, the -fpermissive error isn't a common issue, as it's primarily associated with C++ compilers. In C, focus on resolving typical syntax and type errors rather than dealing with permissiveness. If you encounter a specific error, please provide details for assistance.
30th Sep 2023, 6:56 PM
D1M3
D1M3 - avatar