Question: I am getting this error on this C program In function main: notes.c:36: warning: passing argument 2 of getline from incompatible pointer type /usr/include/stdio.h:673: note:

I am getting this error on this C program

In function main:

notes.c:36: warning: passing argument 2 of getline from incompatible pointer type

/usr/include/stdio.h:673: note: expected size_t * __restrict__ but argument is of type int *

#include #include

void convert(char *s1, char *s2) { int i=0; for(i=0; i= 'a') { // lowercase letter *(s2 + i) = (char)('a' + (25 - (int)(c - 'a'))); } else if(c <= 'Z' && c >= 'A') { printf("Before"); // uppercase letter *(s2 + i) = (char)('A' + (25 - (int)(c - 'A'))); } else { // store as it is if not alphabate *(s2 + i) = c; } } // to terminate the string at last *(s2 + i) = '\0'; }

int main(void) { int size = 1000; // to read the line char *line; // to store encoded text char output[1000]; printf("Enter the text that you want to encode: "); // read the user input getline(&line, &size, stdin); convert(line, output); printf(" The encoded text is: "); printf("%s", output); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!