Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm trying to rotate a bitmap with the command line but i keep getting a segmentation fault(core dumped) error. It works if i don't use

I'm trying to rotate a bitmap with the command line but i keep getting a segmentation fault(core dumped) error. It works if i don't use the command line. Thanks in advance for the help.

int main(int argc, char *argv[]) { extern char *optarg; extern int optind; int degree=0, scale=0,ferror=0; int is_rotate=0, is_scale=0, is_flip=0; //char *inputFile=NULL, *outputFile=NULL; int r, c; PIXEL *b, *nb; readFile("example.bmp",r,c,nb); while((c=getopt(argc,argv,"r:")) != -1) { switch (c) { case 'r': is_rotate=1; rotate(b,r,c,atoi(optarg),&b,&r,&c); free(b); free(nb); break; } } // int r, c; // PIXEL *b, *nb; //readFile("example.bmp", &r, &c, &b); flip(b, &nb, r, c); // rotate(b, r,c,-270,&nb,&r,&c); writeFile("result.bmp", r, c, nb); //enlarge(b,r,c,1000000,&nb,&r,&c); free(b); free(nb); return 0; } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Explain the procedure for valuation of shares.

Answered: 1 week ago

Question

Which months of this year 5 Mondays ?

Answered: 1 week ago

Question

Define Leap year?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago