•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 391,584 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,650 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 178 | Replies: 2
![]() |
•
•
Join Date: May 2008
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Maybe my question is odd, or maybe already answered, but i didn't knew another way of searching a solution (the title i selected may get an idea of how weird is it)
Its quite simple, i'm creating an application that has a command prompt, this is, like ms-dos the C:\>_ , for this, my guess is by using a puts and a fgets (for not bufferoverflow my array) like this:
but this snippet throws me this on my console:
SHELL>
_
In the past time, i've been used terminal libraries like the infamous conio.h in turboc, but now i'm using gnu cc, and i don't know how to do this in C.
In C++ i may do this by using cout && cin
sorry if this looks like a dumb question, and thanks for the help!
Its quite simple, i'm creating an application that has a command prompt, this is, like ms-dos the C:\>_ , for this, my guess is by using a puts and a fgets (for not bufferoverflow my array) like this:
c Syntax (Toggle Plain Text)
puts("SHELL>"); fgets(buffer,MAX_INPUT_LENGTH,stdin);
but this snippet throws me this on my console:
SHELL>
_
In the past time, i've been used terminal libraries like the infamous conio.h in turboc, but now i'm using gnu cc, and i don't know how to do this in C.
In C++ i may do this by using cout && cin
sorry if this looks like a dumb question, and thanks for the help!
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,543
Reputation:
Rep Power: 36
Solved Threads: 860
puts() adds the '\n' to the end of the string. call printf() instead
>>In the past time, i've been used terminal libraries like the infamous conio.h in turboc
That is what you get for learning ancient and obsolete version of C compilers. They teach you very bad habits that are sometimes difficult to unlearn.
printf("SHELL>");
>>In the past time, i've been used terminal libraries like the infamous conio.h in turboc
That is what you get for learning ancient and obsolete version of C compilers. They teach you very bad habits that are sometimes difficult to unlearn.
Last edited by Ancient Dragon : May 14th, 2008 at 7:45 pm.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
Other Threads in the C Forum
- Previous Thread: Timestamp
- Next Thread: Passing type as a parameter; generalised linked list in C?



Linear Mode