The Evolution of a Programmer

  • Thread starter StonyHeartedMan
  • Ngày gửi
S

StonyHeartedMan

Guest
2/10/04
306
2
0
Hà nội
www.vnuni.net
The Evolution of a Programmer

High School/Jr.High



10 PRINT "HELLO WORLD"
20 END

First year in College

program Hello(input, output)
begin
writeln('Hello World')
end.

Senior year in College

(defun hello
(print
(cons 'Hello (list 'World))))

New professional

[HASHTAG]#include[/HASHTAG] <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;

for(i = 0; i < 2; ++i)
printf("%s", message);
printf("\n");
}

Seasoned professional

[HASHTAG]#include[/HASHTAG] <iostream.h>
[HASHTAG]#include[/HASHTAG] <string.h>

class string
{
private:
int size;
char *ptr;

public:
string() : size(0), ptr(new char('\0')) {}

string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}

~string()
{
delete [] ptr;
}

friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};

ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}

string &string::eek:perator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}

int main()
{
string str;

str = "Hello World";
cout << str << endl;

return(0);
}

....

Mất hết format, thôi đọc attached file vậy.
 

Đính kèm

  • The Evolution of a Programmer.zip
    7.7 KB · Lượt xem: 21
Sửa lần cuối:
Webketoan - Khóa Kế toán tổng hợp thực chiến
Học kế toán online cùng Webketoan

Xem nhiều