Hey guys
is there any way you can get a users input from a console based application in c#, so instead of the typing in:
1
+
2
can you do it so it does this:
1 + 2
i know this is easy to do in objective C as it is just scanf and then input the variables but how do you do it in c#
i have looked on the web and cant seem to find it,
any idea's ?
thanks
Harry
User input
Page 1 of 12 Replies - 176 Views - Last Post: 06 October 2012 - 12:43 PM
Replies To: User input
#2
Re: User input
Posted 06 October 2012 - 12:42 PM
Console.ReadLine()? Then Split on the whitespace?
#3
Re: User input
Posted 06 October 2012 - 12:43 PM
Same method, but different commands for C#.
For a console app it would be Console.LineIn
You might want to read up on C#. You can't expect Objective-C and C# to use all the same commands.
My standard beginner resources post
First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover. Do a couple hundred on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.
Then later you can start architecting your own simple stuff. Build a calculator. Build a DVD library program. Etc. Stuff that doesn't involve the complexity of a game. Then move up to games.
There are three routes people seem to take when learning programming.
For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.
You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.
If this sounds like you
read this section
Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.
Resources, references and suggestions for new programmers. - Updated Mar 2012
For a console app it would be Console.LineIn
You might want to read up on C#. You can't expect Objective-C and C# to use all the same commands.
My standard beginner resources post
First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover. Do a couple hundred on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.
Then later you can start architecting your own simple stuff. Build a calculator. Build a DVD library program. Etc. Stuff that doesn't involve the complexity of a game. Then move up to games.
There are three routes people seem to take when learning programming.
- Just start trying to create programs
- Start taking apart other programs and try to figure out the language by reverse engineering
- Follow a guided learning course (school or self-teaching books)
For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.
Quote
Where do I start?
You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.
If this sounds like you
Newbie/Rookie said:
I have a little programming experience but I need to write ...
Spoiler
Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.
Resources, references and suggestions for new programmers. - Updated Mar 2012
Spoiler
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|