C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

My Problem | What is right for ...

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language (Moderated)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Apr 16, 2007 8:19 pm    Post subject: My Problem | What is right for ... Reply with quote



Hi

i was searching google for c vs. c++ for finding good answers for this
question and found here
i searched and viewd last topics aboat this, but i didnt find my
answer ... :(

i'm a php programer and program web application for two years, i know
ruby and rails too ( but not good as php)
i want to start a poor ( i will explain what is poor for me Smile )
programin language in other hand side ( not web, client based ).
i know some Vb, and C# , but this are commersial language ! they are
not fed me ! i want freely !

i think a poor language is a language that i can do everything i want,
what i want ? i want all of thing ...

Linux & Windows Programing, for example ( my dream ) write grahical
user interface for linux like gnome, working with audio and video
codecs, 3d games, write php extension, or hmm write browsers ! write
image editing programs and ... !

look ! i dont want write this programs now ! but i want to do it, when
i need, i want learn c or c++ for do this things, if c can fed me, i
will learn c, or c++ is good ( with OO Suppot Smile ) i will learn cpp, i
dont want to for example learn cpp and when i need to write a porgram
( for example a web server ) i cant do it

please help me friends ....

thanx alot ...
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
WillerZ
Guest





PostPosted: Sat Apr 21, 2007 5:16 pm    Post subject: Re: My Problem | What is right for ... Reply with quote



Oliver Wong wrote:
Quote:
Payam.Babaiy (AT) gmail (DOT) com> wrote in message
news:clcm-20070416-0054 (AT) plethora (DOT) net...
if c can fed me, i
will learn c, or c++ is good ( with OO Suppot Smile ) i will learn cpp, i
dont want to for example learn cpp and when i need to write a porgram
( for example a web server ) i cant do it

Both languages are Turing Complete, meaning essentially any program
you can write in one language, you could also write in the other.

Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of a
turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of a
void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore any
implementation of either language is limited to recording a finite
number of things.
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Keith Thompson
Guest





PostPosted: Mon Apr 23, 2007 10:59 pm    Post subject: Re: My Problem | What is right for ... Reply with quote



WillerZ <newsreplies (AT) willerz (DOT) plus.net> writes:
Quote:
Oliver Wong wrote:
Payam.Babaiy (AT) gmail (DOT) com> wrote in message
news:clcm-20070416-0054 (AT) plethora (DOT) net...
if c can fed me, i
will learn c, or c++ is good ( with OO Suppot Smile ) i will learn cpp, i
dont want to for example learn cpp and when i need to write a porgram
( for example a web server ) i cant do it
Both languages are Turing Complete, meaning essentially any
program you can write in one language, you could also write in the
other.

Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of
a turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of
a void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore
any implementation of either language is limited to recording a finite
number of things.

Files.

--
Keith Thompson (The_Other_Keith) kst-u (AT) mib (DOT) org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Kenneth Brody
Guest





PostPosted: Mon Apr 23, 2007 10:59 pm    Post subject: Re: My Problem | What is right for ... Reply with quote

WillerZ wrote:
Quote:

Oliver Wong wrote:
[... C and C++ ...]
Both languages are Turing Complete, meaning essentially any program
you can write in one language, you could also write in the other.

Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of a
turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of a
void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore any
implementation of either language is limited to recording a finite
number of things.

Nothing says you can't use virtual memory. While it's true not there
is no such thing as "infinite storage", you can have "arbitrarily large
storage". As long as the hardware and O/S support it, you can use an
arbitrarily large storage device, along with some "bignum" library to
hold the data.

Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap (AT) gmail (DOT) com>
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Keith Thompson
Guest





PostPosted: Sat Apr 28, 2007 1:58 am    Post subject: Re: My Problem | What is right for ... Reply with quote

Kenneth Brody <kenbrody (AT) spamcop (DOT) net> writes:
Quote:
WillerZ wrote:

Oliver Wong wrote:
[... C and C++ ...]
Both languages are Turing Complete, meaning essentially any program
you can write in one language, you could also write in the other.

Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of a
turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of a
void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore any
implementation of either language is limited to recording a finite
number of things.

Nothing says you can't use virtual memory. While it's true not there
is no such thing as "infinite storage", you can have "arbitrarily large
storage". As long as the hardware and O/S support it, you can use an
arbitrarily large storage device, along with some "bignum" library to
hold the data.

Addressible storage is still limited by the size of void*. Each byte
of each existing object must have a distinct address, and there can be
at most 2**(CHAR_BIT * sizeof void*) such addresses.

Quote:
Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?

If I recall correctly, it really needs unbounded storage -- which can
(theoretically) be obtained in C by using a file.

--
Keith Thompson (The_Other_Keith) kst-u (AT) mib (DOT) org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Oliver Wong
Guest





PostPosted: Sat Apr 28, 2007 1:58 am    Post subject: Re: My Problem | What is right for ... Reply with quote

"Kenneth Brody" <kenbrody (AT) spamcop (DOT) net> wrote in message
news:clcm-20070423-0008 (AT) plethora (DOT) net...
Quote:
WillerZ wrote:

Oliver Wong wrote:
[... C and C++ ...]
Both languages are Turing Complete, meaning essentially any
program
you can write in one language, you could also write in the other.

Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of a
turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of a
void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore any
implementation of either language is limited to recording a finite
number of things.

I was going to say that the C and C++ languages themselves are Turing
Complete, while particular implementations of those languages may not be,
but the issue was pedantic enough that I was willing to let it slide...

Quote:

Nothing says you can't use virtual memory. While it's true not there
is no such thing as "infinite storage", you can have "arbitrarily large
storage". As long as the hardware and O/S support it, you can use an
arbitrarily large storage device, along with some "bignum" library to
hold the data.

Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?

A TM needs infinite storage simply because you can't know ahead of
time how much storage you need. A "well-formed" (my terminology, not sure
what the official term is) TM will always terminate, and thus does not
actually use an infinite amount of tape. But a "well-formed" TM is not
allowed to report "Error: Ran out of tape", and the only way to satisfy
that requirement is to have infinite tape.

- Oliver
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
WillerZ
Guest





PostPosted: Sat Apr 28, 2007 1:58 am    Post subject: Re: My Problem | What is right for ... Reply with quote

Keith Thompson wrote:
Quote:
WillerZ <newsreplies (AT) willerz (DOT) plus.net> writes:
Oliver Wong wrote:
Payam.Babaiy (AT) gmail (DOT) com> wrote in message
news:clcm-20070416-0054 (AT) plethora (DOT) net...
if c can fed me, i
will learn c, or c++ is good ( with OO Suppot Smile ) i will learn cpp, i
dont want to for example learn cpp and when i need to write a porgram
( for example a web server ) i cant do it
Both languages are Turing Complete, meaning essentially any
program you can write in one language, you could also write in the
other.
Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of
a turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of
a void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore
any implementation of either language is limited to recording a finite
number of things.

Files.

The number of file names available to the standard file routines
(fopen() etc.) is finite; if nothing else its upper bound is the number
of distinct \0-terminated strings which can appear in the finite amount
of addressable storage available.

Since the only way to multiply a finite number by something and end-up
with an infinity is for that something to be an infinity, there would
need to be a C implementation which allows an infinite amount of data to
be stored-to and retrieved-from a single file.

I don't know of any, but I'd be happy to be introduced to one.

In any case, it's largely irrelevant. They're as Turing-Complete as
anything else.
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
WillerZ
Guest





PostPosted: Sat Apr 28, 2007 1:58 am    Post subject: Re: My Problem | What is right for ... Reply with quote

Kenneth Brody wrote:
Quote:
WillerZ wrote:
Oliver Wong wrote:
[... C and C++ ...]
Both languages are Turing Complete, meaning essentially any program
you can write in one language, you could also write in the other.
Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of a
turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of a
void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore any
implementation of either language is limited to recording a finite
number of things.

Nothing says you can't use virtual memory. While it's true not there
is no such thing as "infinite storage", you can have "arbitrarily large
storage". As long as the hardware and O/S support it, you can use an
arbitrarily large storage device, along with some "bignum" library to
hold the data.

The Turing Machine's capacity is unbounded, not arbitrarily large.

Quote:
Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?

Both branches of that or-question are the same so far as I can tell.

The original Turing Machine is defined as having an infinitely-long tape
with one end, at which it starts. It can move in either direction and
read or write any element of its fixed alphabet to any slot on the tape.
There are extended turing machines which have no ends, more
dimensions, multiple moving heads, etc. It has been shown that these
can emulate and be-emulated-by the basic unit, so equivalence to any of
them is equivalence to all of them.

All slots of the tape are initially blank. The output of a turing
machine is the slots of the tape from the start up to the first blank.

At each step, the machine reads the tape slot it's over, writes to that
slot, and moves.

A turing machine with the alphabet { 1, BLANK } might have the following
program:

If read BLANK:
Write 1
Move away from the end

This will never terminate.
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Douglas A. Gwyn
Guest





PostPosted: Sat Apr 28, 2007 1:58 am    Post subject: Re: My Problem | What is right for ... Reply with quote

"Kenneth Brody" <kenbrody (AT) spamcop (DOT) net> wrote in message
news:clcm-20070423-0008 (AT) plethora (DOT) net...
Quote:
Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?

Six of one and a half dozen of the other.

What is getting lost here is the real point, which that any sufficiently
rich
programming language can be used to accomplish any task that another
language in the same class could. There can be considerable differences
in practicality between "equivalent" languages, however.
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Keith Thompson
Guest





PostPosted: Tue May 01, 2007 9:11 am    Post subject: Re: My Problem | What is right for ... Reply with quote

"Oliver Wong" <owong (AT) castortech (DOT) com> writes:
Quote:
"Kenneth Brody" <kenbrody (AT) spamcop (DOT) net> wrote in message
news:clcm-20070423-0008 (AT) plethora (DOT) net...
[...]
Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?

A TM needs infinite storage simply because you can't know ahead of
time how much storage you need. A "well-formed" (my terminology, not sure
what the official term is) TM will always terminate, and thus does not
actually use an infinite amount of tape. But a "well-formed" TM is not
allowed to report "Error: Ran out of tape", and the only way to satisfy
that requirement is to have infinite tape.

You need a potentially unbounded length of tape; the tape doesn't have
to be infinite to begin with.

Assuming a hardware implementation with real physical tape, the system
can just respond to a "Ran out of tape" error by pausing the TM until
more tape is spliced onto the end of the existing tape.

Eventually, though, it could fail when you've converted the entire
mass of the universe (except for the TM itself and its power supply)
to tape. If the universe(s) turn out to be infinite, this won't be a
problem.

--
Keith Thompson (The_Other_Keith) kst-u (AT) mib (DOT) org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Keith Thompson
Guest





PostPosted: Tue May 01, 2007 9:11 am    Post subject: Re: My Problem | What is right for ... Reply with quote

WillerZ <newsreplies (AT) willerz (DOT) plus.net> writes:
Quote:
Keith Thompson wrote:
WillerZ <newsreplies (AT) willerz (DOT) plus.net> writes:
Oliver Wong wrote:
Payam.Babaiy (AT) gmail (DOT) com> wrote in message
news:clcm-20070416-0054 (AT) plethora (DOT) net...
if c can fed me, i
will learn c, or c++ is good ( with OO Suppot Smile ) i will learn cpp, i
dont want to for example learn cpp and when i need to write a porgram
( for example a web server ) i cant do it
Both languages are Turing Complete, meaning essentially any
program you can write in one language, you could also write in the
other.
Actually, no implementation of either language is Turing Complete.

A Turing Complete language is one which can simulate the operation of
a turing machine.

A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.

In C or C++, everything can be addressed by a void *, and the size of
a void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore
any implementation of either language is limited to recording a finite
number of things.

Files.

The number of file names available to the standard file routines
(fopen() etc.) is finite; if nothing else its upper bound is the number
of distinct \0-terminated strings which can appear in the finite amount
of addressable storage available.
[...]


Why do you need an infinite number of file names? I think all you
need is *one* file name, as long as the named file is of unbounded
size. Very large files will cause problems for fseek, ftell, fsetpos,
and fgetpos, but that shouldn't matter for our purposes.

--
Keith Thompson (The_Other_Keith) kst-u (AT) mib (DOT) org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm (AT) plethora (DOT) net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language (Moderated) All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group