visual studio wont scanf
NickName:guyguy Ask DateTime:2020-04-24T20:02:41

visual studio wont scanf

so I started programming in c on visual studio. (i must use vs)

while my instructer can use scanf on vs, i cant (must use scanf_s).

can anyone tell me why? or what other diffrences could be?

another thing is that my instructer ran this (below) code fine, but my computer compile it good but the output is messed up.

#include <stdio.h>
void main()

{

    int x, y;

    char z;

    printf("put expression");

    scanf_s("%d%c%d", &x, &z, &y);

    printf("%d%c%d", x, z, y);

}

*if i only scan int and a char (without the last int) it works fine. (scanf_s("%d%c"))

  • the goal is to input 2+2 and know i can save each of them in diffrent veriables.

why dose my vs act diffrent that my instructer vs? (same code)

how can i fix it? and if i cant how can i know what other diffrences we might have?

thank you guys and have a good weekend!

Copyright Notice:Content Author:「guyguy」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/61407895/visual-studio-wont-scanf

More about “visual studio wont scanf” related questions

visual studio wont scanf

so I started programming in c on visual studio. (i must use vs) while my instructer can use scanf on vs, i cant (must use scanf_s). can anyone tell me why? or what other diffrences could be? ano...

Show Detail

Created the same Program in Unix and Visual Studio 2010, the Visual Studio one wont compile

We are using Emacs on Sun OS 5.9. I wrote the exact same code in both emacs and visual studio and put them in their own folders on the unix server. The one from emacs compiled without a problem but...

Show Detail

Visual studio is skipping the second scanf statement

#define _CRT_SECURE_NO_WARNINGS #include &lt;stdio.h&gt; int main(void) { float value1, value2; double returnValue; /* declaring the output of lollygag*/ /*declares the values that will be

Show Detail

Visual studio 2012 wont install fully

Im trying to install visual studio 2012 to my 64bit windows 8 laptop but it just wont install fully, every time i run the application it keeps asking me to modify, repair or uninstall, I have done ...

Show Detail

Visual studio puts the exe in a different folder and it wont open

So for some reason my visual studio now puts the exe and build output in a different folder and the exe wont open. It used to be in Bin/Debug/Project.exe and now it's Bin/Debug/netcoreapp3.1/projec...

Show Detail

C code compiled with an online C compiler wont run on visual studio anymore

//Program that calculates values from two entered integers #include &lt;stdio.h&gt; int main(void) { int i1; int i2; int sum, diff, prod, quo, rem; printf(&quot;Enter first intege...

Show Detail

C - Error print char with scanf_s in Visual Studio 2012

First, my code: #include &lt;stdio.h&gt; int main(){ int a; char b; printf("Insert number: "); scanf_s("%i",&amp;a); getchar(); printf("Insert chara

Show Detail

Scanf function doesn't run on visual studio

I have been trying to run this program that contains scanf on Visual studio on my Mac but the program never runs. I have tried the scanf without the &amp; too and it still doesn't output any prompt...

Show Detail

Difference between scanf and scanf_s

What is the difference between scanf and scanf_s? In the university I have been taught and I am using scanf, but at my personal computer Visual Studio keeps sending this warning. error C4996: 'sc...

Show Detail

Visual Studio 2013 wont run as administrator

I'm trying to get Visual Studio 2013 running as an administrator, but I'm constantly getting errors. I've searched and tried solutions for other versions of VS, but those fixes didn't apply, so

Show Detail