|
-
Nov 22nd, 2003, 06:39 AM
#1
Are C and Pascal really that different?
I'm learning Pascal at college and decided that it would be interesting to see how much like Pascal I could get C to look like. Well....
Code:
#include "pascal.h"
program
begin
STRING text[81];
writeln ("Hello how are you?");
writeln ("Enter you name:");
readln (text);
write ("Hello ");
writeln (text);
finish
end
Easy with a the help of a few #defines and function declarations from pascal.h:
Code:
#define program int main (void)
#define begin {
#define end }
#define finish return 0;
typedef char STRING;
extern void writeln (const char * str);
extern void readln (char * str);
extern char read (void);
extern void write (const char * str);
And here are the functions: (in a separate source file of course)
Code:
#include <stdio.h>
void writeln (const char * str)
{
puts (str);
}
void readln (char * str)
{
gets (str);
}
void write (const char * str)
{
printf (str);
}
char read (void)
{
return getchar ();
}
So what do you think? Can anyone make it look a little more convincing?
-
Nov 24th, 2003, 06:58 PM
#2
Pascal sucks and so does C
-
Nov 24th, 2003, 07:02 PM
#3
Originally posted by Spetnik
C is a very powerful language. To say it sucks shows that you do not know much about it.
Spetnik also sucks and can't take a joke
-
Nov 24th, 2003, 09:19 PM
#4
Frenzied Member
Originally posted by Spetnik
Well, based on some of the posts I've read here, you never know .
Now that's no joke
-
Nov 25th, 2003, 01:33 AM
#5
No way does C suck. C is in my opinion one of the best programming languages out there. I'm not saying that makes it easy - I'm still learning it now.
You have phenomenal power over your program and can even use C to create new programming languages. PHP for example and Perl are both written in C. I'm sure too that large parts of the VB compiler are written in C or C++ and probably most of the Windows shell.
I may agreee on Pascal though. It seems a very strange programming language and I am not sure who uses it and why.
-
Nov 25th, 2003, 03:18 AM
#6
I don't think that Pascal is used that much anymore. Unless there is apps that are written in Pascal that needs some fixing. That happends all the time.
Some applications are still written in C but C++ are taking over more and more. Like all the apps in Office are now more or less just written in C++, the same things with games....
ØØ
-
Nov 25th, 2003, 07:29 AM
#7
Fanatic Member
Are C and Pascal really that different?
Yes... C has its uses!
To say it sucks is just odd! It may be difficult for some people to understand... but it's incredibly powerful.
-
Nov 25th, 2003, 09:22 AM
#8
Hyperactive Member
Pascal is not much used as a programming language but its still being used to teach beginners about programming becuase of its simplicity and highly structural approcah towards programming.
-
Nov 25th, 2003, 09:40 AM
#9
Retired VBF Adm1nistrator
Originally posted by visualAd
You have phenomenal power over your program and can even use C to create new programming languages. PHP for example and Perl are both written in C. I'm sure too that large parts of the VB compiler are written in C or C++
I'd say the lexical analysis and syntax checking are in C to aide the speed of development, and the compilers and interpreters are in assembly for speed...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 25th, 2003, 09:48 AM
#10
Hyperactive Member
Originally posted by plenderj
I'd say the lexical analysis and syntax checking are in C to aide the speed of development, and the compilers and interpreters are in assembly for speed...
-
Nov 25th, 2003, 03:44 PM
#11
Frenzied Member
Pascal developers have more or less just moved to Delphi. I never learned raw Pascal but I must say, Delphi is pretty awesome.
-
Nov 25th, 2003, 04:53 PM
#12
-
Nov 25th, 2003, 06:03 PM
#13
It helps you make aps....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|