Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #22627 > unrolled thread

Learning C as an existing programmer

Started byrammy <nospam@nospam.com>
First post2012-06-24 21:52 +0000
Last post2012-07-07 11:56 -0700
Articles 20 on this page of 89 — 29 participants

Back to article view | Back to comp.lang.c


Contents

  Learning C as an existing programmer rammy <nospam@nospam.com> - 2012-06-24 21:52 +0000
    Re: Learning C as an existing programmer Ian Collins <ian-news@hotmail.com> - 2012-06-25 10:26 +1200
      Re: Learning C as an existing programmer "Charles Richmond" <numerist@aquaporin4.com> - 2012-06-24 18:28 -0500
        Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 01:05 -0600
        Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 01:10 -0600
          Re: Learning C as an existing programmer Weland <weland@faeroes.freeshell.org> - 2012-06-25 08:20 +0000
            Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-07-02 01:46 -0600
        Re: Learning C as an existing programmer Edward Rutherford <edward.p.rutherford79@REMOVETHIS.gmail.com> - 2012-06-25 20:37 +0000
          Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-25 16:51 -0400
          Re: Learning C as an existing programmer Keith Thompson <kst-u@mib.org> - 2012-06-25 14:25 -0700
            Re: Learning C as an existing programmer Les Cargill <lcargill99@comcast.com> - 2012-06-25 17:50 -0500
            Re: Learning C as an existing programmer William Ahern <william@wilbur.25thandClement.com> - 2012-06-25 16:52 -0700
          Re: Learning C as an existing programmer Les Cargill <lcargill99@comcast.com> - 2012-06-25 17:49 -0500
          Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 00:09 -0700
      Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 00:55 -0600
      Re: Learning C as an existing programmer Nachy <mazwolfe@gmail.com> - 2012-06-25 13:26 -0700
        Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-25 17:07 -0400
        Re: Learning C as an existing programmer Nachy <mazwolfe@gmail.com> - 2012-06-25 14:56 -0700
          Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-25 18:29 -0400
          Re: Learning C as an existing programmer pete <pfiland@mindspring.com> - 2012-06-25 18:56 -0400
            Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 00:21 -0700
              Re: Learning C as an existing programmer Robert Wessel <robertwessel2@yahoo.com> - 2012-06-26 02:56 -0500
              Re: Learning C as an existing programmer Ike Naar <ike@sverige.freeshell.org> - 2012-06-26 08:10 +0000
          Re: Learning C as an existing programmer "J. J. Farrell" <jjf@bcs.org.uk> - 2012-06-26 07:06 +0100
        Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 00:18 -0700
          Re: Learning C as an existing programmer Keith Thompson <kst-u@mib.org> - 2012-06-26 00:23 -0700
          Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-26 06:47 -0400
    Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-25 01:21 +0100
    Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 00:54 -0600
    Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-25 09:19 +0200
      Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 11:15 +0100
        Re: Learning C as an existing programmer "Ronald Benedik" <Aon.912717285@aon.at> - 2012-06-25 12:30 +0200
          Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 11:43 +0100
            Re: Learning C as an existing programmer "Ronald Benedik" <Aon.912717285@aon.at> - 2012-06-25 12:55 +0200
        Re: Learning C as an existing programmer Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-06-25 10:38 +0000
          Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 13:05 +0100
        Re: Learning C as an existing programmer Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-06-25 10:56 +0000
        Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-25 13:34 +0200
          Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 12:43 +0100
            Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-25 15:16 +0200
              Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 14:39 +0100
                Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-26 11:07 +0200
                  Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-26 12:05 +0100
                    Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-26 14:28 +0200
              Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 14:39 +0100
      Re: Learning C as an existing programmer 88888 Dihedral <dihedral88888@googlemail.com> - 2012-06-25 18:21 -0700
        Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-26 11:03 +0200
    Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-25 00:50 -0700
      Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-25 11:50 +0100
        Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-06-25 04:32 -0700
          Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-25 14:25 +0100
            Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-06-26 02:38 -0700
              Re: Learning C as an existing programmer jacob navia <jacob@spamsink.net> - 2012-06-26 12:13 +0200
                Re: Learning C as an existing programmer jacob navia <jacob@spamsink.net> - 2012-06-26 12:15 +0200
                Re: Learning C as an existing programmer Ian Collins <ian-news@hotmail.com> - 2012-06-26 23:08 +1200
              Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-27 01:55 +0100
                Re: Learning C as an existing programmer 88888 Dihedral <dihedral88888@googlemail.com> - 2012-06-26 18:43 -0700
          Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-25 14:27 -0700
            Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-26 00:18 -0700
              Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 04:02 -0700
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 05:54 -0700
                Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 07:22 -0700
                  Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-28 04:28 -0700
                    Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-29 10:07 -0700
                      Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-02 08:57 -0700
                        Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-07-03 03:26 -0700
                          Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 16:28 -0700
                        Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 18:16 -0700
                          Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 04:51 -0700
                            Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-07 16:48 +0100
                              Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 09:07 -0700
                            Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-07 12:27 -0700
                Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-07-03 15:01 +0100
                  Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 16:13 -0700
                    Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-07-07 19:35 +0100
                      Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 11:52 -0700
                      Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-07 19:40 -0700
            Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-06-26 03:03 -0700
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 06:34 -0700
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 06:40 -0700
              Re: Learning C as an existing programmer Gareth Owen <gwowen@gmail.com> - 2012-06-27 07:16 +0100
                Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-27 06:48 -0400
              Re: Learning C as an existing programmer "io_x" <a@b.c.invalid> - 2012-06-28 09:18 +0200
                Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-28 02:02 -0700
                  Re: Learning C as an existing programmer "io_x" <a@b.c.invalid> - 2012-06-28 12:19 +0200
            Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-07-03 15:00 +0100
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 15:56 -0700
                Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 09:18 -0700
                  Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-07 11:56 -0700

Page 1 of 5  [1] 2 3 4 5  Next page →


#22627 — Learning C as an existing programmer

Fromrammy <nospam@nospam.com>
Date2012-06-24 21:52 +0000
SubjectLearning C as an existing programmer
Message-ID<js8275$cpo$1@speranza.aioe.org>
Hi

I need to learn C for numerical analysis as part of my Masters research.

I already have quite a lot of experience with BASIC (my progression was GW 
BASIC -> QBASIC -> Visual BASIC -> VB.net) so I want to find an 
introductory book on "C for BASIC programmers".

I looked through the campus bookstore and didn't really find anything. 
Can you recommend some learning materials that will leverage my existing 
programming knowledge?

Thanks in advance!

[toc] | [next] | [standalone]


#22631

FromIan Collins <ian-news@hotmail.com>
Date2012-06-25 10:26 +1200
Message-ID<a4pih0FaukU3@mid.individual.net>
In reply to#22627
On 06/25/12 09:52 AM, rammy wrote:
> Hi
>
> I need to learn C for numerical analysis as part of my Masters research.
>
> I already have quite a lot of experience with BASIC (my progression was GW
> BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
> introductory book on "C for BASIC programmers".
>
> I looked through the campus bookstore and didn't really find anything.
> Can you recommend some learning materials that will leverage my existing
> programming knowledge?

"The C Programming Language".  C is sufficiently different to justify 
reading through the whole book.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#22632

From"Charles Richmond" <numerist@aquaporin4.com>
Date2012-06-24 18:28 -0500
Message-ID<js87rt$nd9$1@dont-email.me>
In reply to#22631
"Ian Collins" <ian-news@hotmail.com> wrote in message 
news:a4pih0FaukU3@mid.individual.net...
> On 06/25/12 09:52 AM, rammy wrote:
>> Hi
>>
>> I need to learn C for numerical analysis as part of my Masters research.
>>
>> I already have quite a lot of experience with BASIC (my progression was 
>> GW
>> BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
>> introductory book on "C for BASIC programmers".
>>
>> I looked through the campus bookstore and didn't really find anything.
>> Can you recommend some learning materials that will leverage my existing
>> programming knowledge?
>
> "The C Programming Language".  C is sufficiently different to justify 
> reading through the whole book.
>

To understand C well... you have to understand the way C uses pointers.
Pointers are very basically machine memory addresses, and C uses them in
special ways.  IMHO.


--

numerist at aquaporin4 dot com

[toc] | [prev] | [next] | [standalone]


#22651

From"Joe." <antelope3@news.net>
Date2012-06-25 01:05 -0600
Message-ID<js928m$a61$2@speranza.aioe.org>
In reply to#22632
"Charles Richmond" <numerist@aquaporin4.com> wrote in message 
news:js87rt$nd9$1@dont-email.me...
> "Ian Collins" <ian-news@hotmail.com> wrote in message 
> news:a4pih0FaukU3@mid.individual.net...
>> On 06/25/12 09:52 AM, rammy wrote:
>>> Hi
>>>
>>> I need to learn C for numerical analysis as part of my Masters research.
>>>
>>> I already have quite a lot of experience with BASIC (my progression was 
>>> GW
>>> BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
>>> introductory book on "C for BASIC programmers".
>>>
>>> I looked through the campus bookstore and didn't really find anything.
>>> Can you recommend some learning materials that will leverage my existing
>>> programming knowledge?
>>
>> "The C Programming Language".  C is sufficiently different to justify 
>> reading through the whole book.
>>
>
> To understand C well... you have to understand the way C uses pointers.
> Pointers are very basically machine memory addresses, and C uses them in
> special ways.  IMHO.
>

Your "humble" opinion is no longer relevant. C and snake oil are related 
how? If you can't answer that question, then you are a <something>. It's one 
thing to be a "bullshitter", quite another to be a victim of bullshitters. 
Or in the "worst" case, bullshit politics. Ha! Are not politics and bullshit 
the same thing?

:(  BS is casual. Politics hurt, maim and kill people.

Don't everyone think you make me think. Apparently that is Warren Buffet's 
job? Apparently he is so fucking "rich" he can't even give away what he did 
legally. Hmm? What does an old man with a lot of money have to say? 
Rhetorical, cuz we know what he said.

Peace be with you, "rich" man. 

[toc] | [prev] | [next] | [standalone]


#22652

From"Joe." <antelope3@news.net>
Date2012-06-25 01:10 -0600
Message-ID<js92ik$aum$1@speranza.aioe.org>
In reply to#22632
"Stefan Ram" <ram@zedat.fu-berlin.de> wrote in message 
news:pointers-20120625015219@ram.dialup.fu-berlin.de...
> "Charles Richmond" <numerist@aquaporin4.com> writes:
>>To understand C well... you have to understand the way C uses pointers.
>>Pointers are very basically machine memory addresses, and C uses them in
>>special ways.
>
>  An object o of type T is a region of memory that is just
>  large enough to store a single value of T.
>

How does it feel to be a textbook instead of a person? 

[toc] | [prev] | [next] | [standalone]


#22659

FromWeland <weland@faeroes.freeshell.org>
Date2012-06-25 08:20 +0000
Message-ID<slrn3vfsjug7ph.jm5.weland@faeroes.freeshell.org>
In reply to#22652
On 2012-06-25, Joe. <antelope3@news.net> wrote:
> How does it feel to be a textbook instead of a person? 

You owe me a new keyboard, I just spilled coffee all over mine when I burst
into laughter.

-- 
weland@sdf.org
SDF Public Access UNIX System - http://sdf.org
% grep me no patterns and I'll tell you no lines

[toc] | [prev] | [next] | [standalone]


#23071

From"Joe." <antelope3@news.net>
Date2012-07-02 01:46 -0600
Message-ID<jsrjg9$4dk$1@speranza.aioe.org>
In reply to#22659
"Weland" <weland@faeroes.freeshell.org> wrote in message 
news:slrn3vfsjug7ph.jm5.weland@faeroes.freeshell.org...
> On 2012-06-25, Joe. <antelope3@news.net> wrote:
>> How does it feel to be a textbook instead of a person?
>
> You owe me a new keyboard, I just spilled coffee all over mine when I 
> burst
> into laughter.
>

Why don't I find that funny? 

[toc] | [prev] | [next] | [standalone]


#22715

FromEdward Rutherford <edward.p.rutherford79@REMOVETHIS.gmail.com>
Date2012-06-25 20:37 +0000
Message-ID<jsai5p$9o8$1@speranza.aioe.org>
In reply to#22632
Charles Richmond wrote:
> "Ian Collins" <ian-news@hotmail.com> wrote in message
> news:a4pih0FaukU3@mid.individual.net...
>> On 06/25/12 09:52 AM, rammy wrote:
>>> Hi
>>>
>>> I need to learn C for numerical analysis as part of my Masters
>>> research.
>>>
>>> I already have quite a lot of experience with BASIC (my progression
>>> was GW
>>> BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
>>> introductory book on "C for BASIC programmers".
> To understand C well... you have to understand the way C uses pointers.
> Pointers are very basically machine memory addresses, and C uses them in
> special ways.  IMHO.

Any Basic programmer understands pointers! A pointer is basically the 
same thing as a ByRef function argument.

The only exception is strings, which are a special type in C. For 
technical reasons they are officially pointers (char *) but in fact this 
is really just the string type, so char ** is a ByRef string.

[toc] | [prev] | [next] | [standalone]


#22718

FromJames Kuyper <jameskuyper@verizon.net>
Date2012-06-25 16:51 -0400
Message-ID<4FE8CF4A.4020103@verizon.net>
In reply to#22715
On 06/25/2012 04:37 PM, Edward Rutherford wrote:
...
> Any Basic programmer understands pointers! A pointer is basically the 
> same thing as a ByRef function argument.
> 
> The only exception is strings, which are a special type in C. For 
> technical reasons they are officially pointers (char *) but in fact this 
> is really just the string type, so char ** is a ByRef string.

It's been more than three decade since I used Basic, and I'm pretty sure
that the Basic I used didn't have ByRef, so I can't comment on that
aspect of your message.

However, in C, strings are a data storage format, not a data type.
Saying otherwise can cause more confusion than is justified by the
simplification it allows. Thinking otherwise has been the cause of a lot
of erroneous code.

[toc] | [prev] | [next] | [standalone]


#22732

FromKeith Thompson <kst-u@mib.org>
Date2012-06-25 14:25 -0700
Message-ID<lnobo75bjs.fsf@nuthaus.mib.org>
In reply to#22715
Edward Rutherford <edward.p.rutherford79@REMOVETHIS.gmail.com> writes:
[...]
> Any Basic programmer understands pointers! A pointer is basically the 
> same thing as a ByRef function argument.
>
> The only exception is strings, which are a special type in C. For 
> technical reasons they are officially pointers (char *) but in fact this 
> is really just the string type, so char ** is a ByRef string.

No, strings are not pointers.

A string is, by definition, "a contiguous sequence of characters
terminated by and including the first null character".

A char* value that points to the first character of a string is referred
to as a "pointer to a string".

We commonly (actually, almost universally) use pointers of type char* to
manipulate strings, but the pointer itself is not the string.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
    Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#22738

FromLes Cargill <lcargill99@comcast.com>
Date2012-06-25 17:50 -0500
Message-ID<jsapp2$ed8$2@dont-email.me>
In reply to#22732
Keith Thompson wrote:
> Edward Rutherford <edward.p.rutherford79@REMOVETHIS.gmail.com> writes:
> [...]
>> Any Basic programmer understands pointers! A pointer is basically the
>> same thing as a ByRef function argument.
>>
>> The only exception is strings, which are a special type in C. For
>> technical reasons they are officially pointers (char *) but in fact this
>> is really just the string type, so char ** is a ByRef string.
>
> No, strings are not pointers.
>
> A string is, by definition, "a contiguous sequence of characters
> terminated by and including the first null character".
>
> A char* value that points to the first character of a string is referred
> to as a "pointer to a string".
>
> We commonly (actually, almost universally) use pointers of type char* to
> manipulate strings, but the pointer itself is not the string.
>

Hence the cliche of "Ceci n'est pas une pipe" in programmer lore...

--
Les Cargill

[toc] | [prev] | [next] | [standalone]


#22741

FromWilliam Ahern <william@wilbur.25thandClement.com>
Date2012-06-25 16:52 -0700
Message-ID<37anb9-du2.ln1@wilbur.25thandClement.com>
In reply to#22732
Keith Thompson <kst-u@mib.org> wrote:
> Edward Rutherford <edward.p.rutherford79@REMOVETHIS.gmail.com> writes:
> [...]
> > Any Basic programmer understands pointers! A pointer is basically the 
> > same thing as a ByRef function argument.
> >
> > The only exception is strings, which are a special type in C. For 
> > technical reasons they are officially pointers (char *) but in fact this 
> > is really just the string type, so char ** is a ByRef string.

> No, strings are not pointers.

> A string is, by definition, "a contiguous sequence of characters
> terminated by and including the first null character".

> A char* value that points to the first character of a string is referred
> to as a "pointer to a string".

> We commonly (actually, almost universally) use pointers of type char* to
> manipulate strings, but the pointer itself is not the string.

If you google the short history of Edward Rutherford's posts, you quickly
come to suspect that he's something of benevolent troll. He appears to have
his thumb on the pulse of this newsgroup and can generate, with the most
earnest seeming comments, very long and quite sincere threads. I say
benevolent because the responses he generates are the kind usually given.
Rather than discord he appears to enjoy purely the manipulation.

I would beware.

[toc] | [prev] | [next] | [standalone]


#22737

FromLes Cargill <lcargill99@comcast.com>
Date2012-06-25 17:49 -0500
Message-ID<jsapmh$ed8$1@dont-email.me>
In reply to#22715
Edward Rutherford wrote:
> Charles Richmond wrote:
>> "Ian Collins" <ian-news@hotmail.com> wrote in message
>> news:a4pih0FaukU3@mid.individual.net...
>>> On 06/25/12 09:52 AM, rammy wrote:
>>>> Hi
>>>>
>>>> I need to learn C for numerical analysis as part of my Masters
>>>> research.
>>>>
>>>> I already have quite a lot of experience with BASIC (my progression
>>>> was GW
>>>> BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
>>>> introductory book on "C for BASIC programmers".
>> To understand C well... you have to understand the way C uses pointers.
>> Pointers are very basically machine memory addresses, and C uses them in
>> special ways.  IMHO.
>
> Any Basic programmer understands pointers! A pointer is basically the
> same thing as a ByRef function argument.
>
> The only exception is strings, which are a special type in C. For
> technical reasons they are officially pointers (char *) but in fact this
> is really just the string type, so char ** is a ByRef string.
>


Dunno from ByRef semantics, but no - char * is sufficient to have
a by-reference declaration of a string. It is not enough to instantiate
one ( initialize the pointer itself ).

char **  (outside of an initialization)
is usually a sign you've done something horribly wrong :)

--
Les Cargill

[toc] | [prev] | [next] | [standalone]


#22756

Fromnick_keighley_nospam@hotmail.com
Date2012-06-26 00:09 -0700
Message-ID<0cc85f94-f24e-4347-8e03-106dcfb77494@googlegroups.com>
In reply to#22715
On Monday, June 25, 2012 9:37:13 PM UTC+1, Edward Rutherford wrote:
> Charles Richmond wrote:
> > "Ian Collins" <ian-news@hotmail.com> wrote in message
> > news:a4pih0FaukU3@mid.individual.net...
> >> On 06/25/12 09:52 AM, rammy wrote:

> >>> I need to learn C for numerical analysis as part of my Masters
> >>> research.
> >>>
> >>> I already have quite a lot of experience with BASIC [...]
> >
> > To understand C well... you have to understand the way C uses pointers.
> > Pointers are very basically machine memory addresses, and C uses them in
> > special ways.  IMHO.
> 
> Any Basic programmer understands pointers! A pointer is basically the 
> same thing as a ByRef function argument.

I don't recall Dartmouth BASIC having "ByRef" pointers. (the point being, "Basic" is a rather ill-defined term).

> The only exception is strings, which are a special type in C.

no they aren't. There is no "string type" in C.

> For 
> technical reasons they are officially pointers (char *) but in fact this 
> is really just the string type, so char ** is a ByRef string.

nonsense

[toc] | [prev] | [next] | [standalone]


#22650

From"Joe." <antelope3@news.net>
Date2012-06-25 00:55 -0600
Message-ID<js928l$a61$1@speranza.aioe.org>
In reply to#22631
"Ian Collins" <ian-news@hotmail.com> wrote in message 
news:a4pih0FaukU3@mid.individual.net...
> On 06/25/12 09:52 AM, rammy wrote:
>> Hi
>>
>> I need to learn C for numerical analysis as part of my Masters research.
>>
>> I already have quite a lot of experience with BASIC (my progression was 
>> GW
>> BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
>> introductory book on "C for BASIC programmers".
>>
>> I looked through the campus bookstore and didn't really find anything.
>> Can you recommend some learning materials that will leverage my existing
>> programming knowledge?
>
> "The C Programming Language".  C is sufficiently different to justify 
> reading through the whole book.
>

You are so aberrated! (I don't spell check). 

[toc] | [prev] | [next] | [standalone]


#22713

FromNachy <mazwolfe@gmail.com>
Date2012-06-25 13:26 -0700
Message-ID<8f12fe88-2fe4-45c2-bbb2-6b7f63a6137c@st3g2000pbc.googlegroups.com>
In reply to#22631
On Jun 24, 6:26 pm, Ian Collins <ian-n...@hotmail.com> wrote:
> On 06/25/12 09:52 AM, rammy wrote:
>
> > Hi
>
> > I need to learn C for numerical analysis as part of my Masters research.
>
> > I already have quite a lot of experience with BASIC (my progression was GW
> > BASIC ->  QBASIC ->  Visual BASIC ->  VB.net) so I want to find an
> > introductory book on "C for BASIC programmers".
>
> > I looked through the campus bookstore and didn't really find anything.
> > Can you recommend some learning materials that will leverage my existing
> > programming knowledge?
>
> "The C Programming Language".  C is sufficiently different to justify
> reading through the whole book.

I actually took a similar path myself - well, not quite: QBasic ->
8086 Assembly -> C  (-> C++) -> Java (the latter is job-related; the
others were hobbies...).

I found that the best book for C is still "The C Programming Language"
- despite its age - as has been pointed out.  As for moving between
BASIC and C - I don't know what book will be best, and any that I've
seen are more than 20 years old.  However, I thought of a few pointers
to help cover the major differences:

1) C code is not line oriented.
- Multiple statements may be on the same line
- A statement can be broken into several lines
- Statements are ended with a semicolon (';') instead of a line break
- Blocks are delimited by braces ('{' and '}'), instead of END at the
bottom

2) case matters.
- "if" is not the same as "If" or "IF"
- Nearly everything in C is lowercase - keywords and the standard
library.
    _Exit() is the only exception I can think of.
- Constants are UPPERCASE (as in many languages, including BASIC)
- Identifiers with several words use under_scores, not CamelCase

3) Strings are not first-class types.
- String literals are given some special treatment by the compiler,
but ...
- Strings break down into NUL terminated arrays of char

- String concatenation is not automatic

3) Many tasks are accomplished by library functions instead of being
statements built in to the language.
- This includes basic input, output, file operations, and mathematical
functions
- Use puts() instead of PRINT, printf() instead of PRINT USING,
scanf() instead of INPUT
- Any user-friendly GUI is non-standard (as far as C is concerned).
There are libraries other than the C standard library available for
various platforms, each of which has its own standards.

4) You have to put a lot more effort into memory management.
- malloc() instead of DIM (whatever that stands for)
- Pointers are used much more heavily than in BASIC (which has some
pointer ability)

That's all that I can think of offhand, but I think that's plenty.

Happy programming!

-- Nachy

[toc] | [prev] | [next] | [standalone]


#22724

FromJames Kuyper <jameskuyper@verizon.net>
Date2012-06-25 17:07 -0400
Message-ID<4FE8D31E.1080300@verizon.net>
In reply to#22713
On 06/25/2012 04:26 PM, Nachy wrote:
...
> - despite its age - as has been pointed out.  As for moving between
> BASIC and C - I don't know what book will be best, and any that I've
> seen are more than 20 years old.  However, I thought of a few pointers
> to help cover the major differences:
...
> - Nearly everything in C is lowercase - keywords and the standard
> library.
>     _Exit() is the only exception I can think of.

There are few more exceptions that than. If most of these seem
unfamiliar, that's probably because they were all introduced in either
C99 or C2011:

keywords:
_Alignas, _Alignof, _Atomic, _Bool, _Complex, _Generic, _Imaginary,
_Noreturn, _Static_assert, _Thread_local

Standard Pragmas:
STDC FENV_ACCESS
STDC FP_CONTRACT
STDC CX_LIMITED_RANGE

Function-like macros:
CMPLX, CMPLXF, CMPLXL
ATOMIC_VAR_INIT
[U]INT[N|MAX]_C

[toc] | [prev] | [next] | [standalone]


#22735

FromNachy <mazwolfe@gmail.com>
Date2012-06-25 14:56 -0700
Message-ID<a1c10068-5bc2-4802-a461-29e0927a8d3d@vs10g2000pbc.googlegroups.com>
In reply to#22713
On Jun 25, 4:38 pm, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
> Nachy <mazwo...@gmail.com> writes:

This was to be a _quick_ list of the glaring differences between BASIC
and C for the purpose of helping the OP migrate from one the former to
the latter (or at least pointing him in the right direction).  As
such, I was trying not to get too technical, and so may have
sacrificed strict accuracy for brevity and clarity.  I don't think you
can argue with my basic statements, though you may disagree with some
minor point.

> >- Statements are ended with a semicolon (';') instead of a line break
>
>   »{}« is a statement that does not end with a semicolon.
>   (Use »expression statement« above.)

I stand by my original comment.  "Expression statement" would exclude
jump statements ("continue", "break", "return") which are not
(necessarily) followed by an expression, and the expression in a do
loop must be in parenthesis - the semicolon following the expression
is part of the do loop, not an expression statement.

>
> >- Constants are UPPERCASE (as in many languages, including BASIC)
>
>   Uppercase is used for most preprocessor macros,
>   which might sometimes expand to literals.

Good point.
s/Constants/Constants and macros/

>
> >- String concatenation is not automatic
>
>   Well, »"abc" "def"« gives »abcdef«.

Specifically for string literals, which is (1) the preprocessor, and
(2) a less beginner corollary of "String literals are given some
special treatment by the compiler"

James wrote:
> There are few more exceptions that than. If most of these seem
> unfamiliar, that's probably because they were all introduced in either
> C99 or C2011:
>
> keywords:
> _Alignas, _Alignof, _Atomic, _Bool, _Complex, _Generic, _Imaginary,
> _Noreturn, _Static_assert, _Thread_local
>
> Standard Pragmas:
> STDC FENV_ACCESS
> STDC FP_CONTRACT
> STDC CX_LIMITED_RANGE
>
> Function-like macros:
> CMPLX, CMPLXF, CMPLXL
> ATOMIC_VAR_INIT
> [U]INT[N|MAX]_C

Indeed.  And none of these are to be found in "The C Programming
Language", which was the text originally suggested.  :)

In fact, most (all?) of the all-uppercase James mentions are
preprocessor macros.

You missed the one exception to the macro/constant rule: FILE (which
is a type, not a macro, unless by the as-if rule).

-- Nachy

[toc] | [prev] | [next] | [standalone]


#22736

FromJames Kuyper <jameskuyper@verizon.net>
Date2012-06-25 18:29 -0400
Message-ID<4FE8E63E.6020701@verizon.net>
In reply to#22735
On 06/25/2012 05:56 PM, Nachy wrote:
...
> James wrote:
>> There are few more exceptions that than. If most of these seem
>> unfamiliar, that's probably because they were all introduced in either
>> C99 or C2011:
>>
>> keywords:
>> _Alignas, _Alignof, _Atomic, _Bool, _Complex, _Generic, _Imaginary,
>> _Noreturn, _Static_assert, _Thread_local
>>
>> Standard Pragmas:
>> STDC FENV_ACCESS
>> STDC FP_CONTRACT
>> STDC CX_LIMITED_RANGE
>>
>> Function-like macros:
>> CMPLX, CMPLXF, CMPLXL
>> ATOMIC_VAR_INIT
>> [U]INT[N|MAX]_C
> 
> Indeed.  And none of these are to be found in "The C Programming
> Language", which was the text originally suggested.  :)
> 
> In fact, most (all?) of the all-uppercase James mentions are
> preprocessor macros.

No, the standard pragmas take effect during pre-processing, just like
macros, but they aren't macros.

> You missed the one exception to the macro/constant rule: FILE (which
> is a type, not a macro, unless by the as-if rule).

I'm not surprised - I was keeping an eye out for _Exit(), since you'd
already mentioned it, and I still missed it, so I wouldn't be surprised
if I missed a few others, too. The keywords and Pragmas are all listed
together, which made them a lot easier to find.

[toc] | [prev] | [next] | [standalone]


#22739

Frompete <pfiland@mindspring.com>
Date2012-06-25 18:56 -0400
Message-ID<4FE8EC82.546@mindspring.com>
In reply to#22735
Nachy wrote:
> 
> On Jun 25, 4:38 pm, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
> > Nachy <mazwo...@gmail.com> writes:

> > >- Constants are UPPERCASE (as in many languages, including BASIC)
> >
> >   Uppercase is used for most preprocessor macros,
> >   which might sometimes expand to literals.
> 
> Good point.
> s/Constants/Constants and macros/

But that's not the case.

(stderr), (stdin), and (stdout) 
are three examples of lowercase macros.

-- 
pete

[toc] | [prev] | [next] | [standalone]


Page 1 of 5  [1] 2 3 4 5  Next page →

Back to top | Article view | comp.lang.c


csiph-web