You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
and then int the main function after writing scanf and some additional printf statement,
#include <stdio.h>
int main(int argc, char const *argv[]) {
int a;
printf("enter the number\n");
scanf("%d\n", &a);
printf("%d\n", a);
return 0;
}
the \n is the problem in the scanf the \n in the printf and everywhere else is just fine. Expected behavior:
after writing the code, i expect something like this:
Actual behavior:
this is what actually happens: the scanf instead of progressing the code moves the cursor to the new line , demanding another value
Reproduces how often:
100%
Versions
i am running the latest version of linuxmint
Additional Information
it is fine on other text editors as the do not provide the extra \n with scanf, atom needs to change it .
I took me nearly an hour to figure this out after getting multiple errors.
Thankyou.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Prerequisites
[X] Put an X between the brackets on this line if you have done all of the following:
* Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
* Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
* Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
* Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
* Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
in the C syntax, when using _scanf_ , by default it gives the user this as the syntax:scanf("%s\n", );
now everything seems to be ok, BUT, after %s the \n is the main problem as shown belowSteps to Reproduce
I have run the code in normal as well as safe mode.
Expected behavior:
after writing the code, i expect something like this:
Actual behavior:
this is what actually happens: the scanf instead of progressing the code moves the cursor to the new line , demanding another value
Reproduces how often:
100%
Versions
i am running the latest version of linuxmint
Additional Information
it is fine on other text editors as the do not provide the extra \n with scanf, atom needs to change it .
I took me nearly an hour to figure this out after getting multiple errors.
Thankyou.
The text was updated successfully, but these errors were encountered: