473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

In C, is there a way to printf after scanf and return to the scanf?

Ripedox
I am talking about something like this:
Expand|Select|Wrap|Line Numbers
  1. printf(".............");
  2. scanf();
  3. printf("............."):
  4.  
So the output would be:
............
_
............

"_" is where the user would input the value.
Mar 29 '14 #1
4 1210
weaknessforcats
9,208 Expert Mod 8TB
Can you not just display a \n as the last character in the printf above the scanf ?
Mar 29 '14 #2
That would still make text appear above the scanf, not after it.
Mar 29 '14 #3
weaknessforcats
9,208 Expert Mod 8TB
Can you not display a \n as the first character in the printf following the scanf?
Mar 30 '14 #4
donbock
2,426 Expert 2GB
Do you want to print out several lines and then scan input such that the echoed input appears in the middle of those printed lines?

The generic name for this type of activity is cursor control. The C Standard does not provide a portable way to do this. You need a platform-specific library or you can embed platform-specific cursor control commands in your printf output. The examples I can provide reveal my age: curses or VT-100 control codes.
Mar 31 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Stefan Slapeta | last post by:
Hi, this code does not compile in C#: class base_class {} class derived_class : base_class {} class A { public virtual base_class f()
3
by: Agnes | last post by:
In my old vfp application, there is DTOS function to return 'yyyymm' ,in .net any similar function ?? DTOS(datetime.now) and return yyyymm, I know that I can CType(Year(datetime.now), String) &...
4
by: academic | last post by:
Is there an expected difference between the following? Stepping seems to show that the first way GetContextMenuControlWindowsExplorer does exhibit the correct data in this sub But not in the...
6
by: ABC | last post by:
Is there any function return the short date format on the regional and Language Options under control panel?
34
by: priyanka | last post by:
Hi, I was wondering if we could parse or do something in the executable( whose source language was C). How can I use some scripting language like perl/python to find out the information about...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.