B
babs
Guest
Re: BABS! Other PC experts too... HELP!!!
I'm no visual basic programmer, but in plain basic you could do it with a line similar to.
old Basic allows you to assing variables on the fly, like above where I've just made a variable up called name$ to store the input. You'd then output it with PRINT name$ or do whatever to it.
In C++ you'd normally declare the variables at the start of the function (program)
That declares two variables, the first a string (alphanumeric characters), the second an integer (any whole number). C++ gets a bit more complicated but an example of how you'd use them is.
the "/n" just sticks a carriage return in.
If you want to do some basic (as in entry level) programming, you could do worse than to get hold of Bloodshed Dev-C++ (free compiler/debugger/editor) and head over to http://www.cprogramming.com/tutorial/lesson1.html for some excellent tutorials. The link to Dev-C++ is actually at the top of that tutorial page.
Making your own little programs and seeing them run is immensly satisfying.
I'm no visual basic programmer, but in plain basic you could do it with a line similar to.
Code:
PRINT "Enter your name: "; INPUT name$
old Basic allows you to assing variables on the fly, like above where I've just made a variable up called name$ to store the input. You'd then output it with PRINT name$ or do whatever to it.
In C++ you'd normally declare the variables at the start of the function (program)
Code:
[b]string[/b] myName;
[b]int[/b] myAge;
Code:
[b]cout[/b]<<"What is your name? :";
[b]cin[/b]>>myName;
[b]cout[/b]<<"So your name is " << myname <<"/n";
If you want to do some basic (as in entry level) programming, you could do worse than to get hold of Bloodshed Dev-C++ (free compiler/debugger/editor) and head over to http://www.cprogramming.com/tutorial/lesson1.html for some excellent tutorials. The link to Dev-C++ is actually at the top of that tutorial page.
Making your own little programs and seeing them run is immensly satisfying.