Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C, I am writing a program which take a string as input, and then put it into an character array. I have code like

In C, I am writing a program which take a string as input, and then put it into an character array.

I have code like this.

char guess[20];

scanf("%s",&guess);

The code works fine but it keep give me a warning,

/autograder/submission/moo.c:111:12: error: format %s expects argument of type char *, but argument 2 has type char (*)[20] [-Werror=format=] scanf("%s",&guess);} 

I sort of understand what it says but have no idea how to fix it...

please help! thanks

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions