PaulW
Member
Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
|
From what I can understand... something like this model??
quote: Enter Char 1 : A
Enter Char 2 : B
Enter Char 3 : C
Display Output:
ABC....A.B.C
When you press the key to enter each char, it just reads that single charecter, then asks for the next one, etc.. then displays the output like you say & like in this little model?
|
PaulW
Member
Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
|
quote: Originally posted by Paul_J
Assembler is ghey!
Couldn't agree more with you there!! Is ok for real low level stuff like boot loaders, etc, but for when your already booted into an OS (like DOS here), then just use something like C/C++, Basic, Pascal, Cobol, etc...
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
i'll get back 2 ya least u know ur stuff!
cheers
|
Paul_J
Member
Registered: 6th Jun 02
Location: London
User status: Offline
|
Exactly - when I was being taught assembler I couldn't help thinking 'Wtf is the point?'
they kept saying 'ah yes, but it hardly uses any memory and is very fast' - but in today's age memory isn't a big problem like it used to be and if I want to bloody add 2 numbers together I'll write a bloody program in C++ to do it or use a calculator
C++ is v.easy, never realised how easy it was, always thought it was going to be hard - but after assembler anything where things are pretty much in english is nice...
Paul J
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
J++ is getting easier too i think...
1st project due soon
|
PaulW
Member
Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
|
Absolutely pointless program but what the hey, written on Linux though
quote: #include <string>
#include <iostream>
using namespace std;
main()
{
string a("abcd efg");
string b("xyz ijk");
string c;
cout << a << " " << b << endl;
cout << "String empty: " << c.empty() << endl;
c = a + b;
cout << c << endl;
cout << "String length: " << c.length() << endl;
cout << "String size: " << c.size() << endl;
cout << "String capacity: " << c.capacity() << endl;
cout << "String empty: " << c.empty() << endl;
string d = c;
cout << d << endl;
cout << "First character: " << c[0] << endl;
string f(" Leading and trailing blanks ");
cout << "String f:" << f << endl;
cout << "String length: " << f.length() << endl;
cout << "String f:" << f.append("ZZZ") << endl;
cout << "String length: " << f.length() << endl;
string g("abc abc abd abc");
cout << "String g: " << g << endl;
cout << "Replace 12,1,\"xyz\",3: " << g.replace(12,1,"xyz",3) << endl;
cout << g.replace(0,3,"xyz",3) << endl;
cout << g.replace(4,3,"xyz",3) << endl;
cout << g.replace(4,3,"ijk",1) << endl;
cout << "Find: " << g.find("abd",1) << endl;
cout << g.find("qrs",1) << endl;
string h("abc abc abd abc");
cout << "String h: " << h << endl;
cout << "Find \"abc\",0: " << h.find("abc",0) << endl;
cout << "Find \"abc\",1: " << h.find("abc",1) << endl;
cout << "Find_first_of \"abc\",0: " << h.find_first_of("abc",0) << endl;
cout << "Find_last_of \"abc\",0: " << h.find_last_of("abc",0) << endl;
cout << "Find_first_not_of \"abc\",0: " << h.find_first_not_of("abc",0) << endl;
cout << "Find_first_not_of \" \": " << h.find_first_not_of(" ") << endl;
cout << "Substr 5,9: " << h.substr(5,9) << endl;
cout << "Compare 0,3,\"abc\": " << h.compare(0,3,"abc") << endl;
cout << "Compare 0,3,\"abd\": " << h.compare(0,3,"abd") << endl;
cout << h.assign("xyz",0,3) << endl;
cout << "First character: " << h[0] << endl;
}
when compiled usin g++, cmd ./a.out lists all this crap
quote: abcd efg xyz ijk
String empty: 1
abcd efgxyz ijk
String length: 15
String size: 15
String capacity: 15
String empty: 0
abcd efgxyz ijk
First character: a
String f: Leading and trailing blanks
String length: 37
String f: Leading and trailing blanks ZZZ
String length: 40
String g: abc abc abd abc
Replace 12,1,"xyz",3: abc abc abd xyzbc
xyz abc abd xyzbc
xyz xyz abd xyzbc
xyz i abd xyzbc
Find: 6
4294967295
String h: abc abc abd abc
Find "abc",0: 0
Find "abc",1: 4
Find_first_of "abc",0: 0
Find_last_of "abc",0: 0
Find_first_not_of "abc",0: 3
Find_first_not_of " ": 0
Substr 5,9: bc abd ab
Compare 0,3,"abc": 0
Compare 0,3,"abd": -1
xyz
First character: x
I think I best get some sleep before I go fekin mad!
[Edited on 07-11-2003 by PaulW]
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
huh?
|
PaulW
Member
Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
|
just verrrrrry bored tonight!
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
hope ur even more bored tommorow gimmi a hand!
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
write an assembly language program which will read nine characters from the keyboard with echo and display them as a 3x3 matrix, tabbed and spaced as shown eg if a,b,c,d,e,f,g,h,i is the input then the screen should have the appearance:
ABC.......A B C
DEF ...... D E F
GHI......G H I
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
thats it... iv about 1hr to do it :S
|
Jason
Member
Registered: 5th Aug 03
Location: Northern Ireland
User status: Offline
|
help
|
|