Question: I am a student learning C programming. I am using Visual Studio 2017, so i think there is no issues using _s(underscore s). I am

I am a student learning C programming. I am using Visual Studio 2017, so i think there is no issues using _s(underscore s). I am having an error whenever i try to run this code. My program can be built but have memory error. Is there anything i miss out for using VS2017 because it is known to be staying with standalone codes even though same language. Thanks.

#include "stdafx.h" #include "string.h" #include "stdlib.h" int main() { char name[11] = "John Terry"; printf("My name is %s ", name);

name[2] = 'I'; printf("My name is %s ", name);

char food[] = "burger"; printf("I love %s ", food); strcpy_s(food, "chocalate"); printf_s("I love %s ", food); 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!