Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.c

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2012, 09:52 PM
rammy
Guest
 
Posts: n/a
Default Learning C as an existing programmer

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!
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 06-24-2012, 10:26 PM
Ian Collins
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

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
Reply With Quote
  #3 (permalink)  
Old 06-24-2012, 11:28 PM
Charles Richmond
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

"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

Reply With Quote
  #4 (permalink)  
Old 06-25-2012, 12:21 AM
Ben Bacarisse
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

rammy <nospam@nospam.com> writes:

> 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?


If your application makes extensive use of arrays or of complex numbers,
you might want to find out if you have access to an implementation of
the 1999 standard of C. Many of the books about C concentrate on 1990 C
(often called, rather confusingly, "ANSI C") but C99 added complex
numbers and some array facilities that might be helpful for numerical
programs.

--
Ben.
Reply With Quote
  #5 (permalink)  
Old 06-25-2012, 12:33 AM
Stefan Ram
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

"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.

The address a of such an object is written as &o
using the unary prefix operator & (address of).
We say that &o referred to the object or location o.

The type of a is written as T*. This is a pointer type.
An object of pointer type can store a value of such a
pointer type.

Given a, to get the value of the object o, we use *a,
with the unary prefix operator *. One says that this
dereferred a.

*&o = o

&o+1 is the address just behind this object o, that
can be obtained by skipping the size of the object o
once. &o+i are i such skips.

For an int value i, a[i] means *(a+i).

*a = a[0]
a+i = &a[i]

T*p; declares p to be a pointer to an object of type T.

p=0 makes p not to point to anything, directly after this
p is a null pointer. A null pointer cannot be used for
anything else than to mark the absence of a pointer that
refers an object.

Pointers can be compared with == and != (even the null
pointer) and be compared with > and so on when reasonable.

if(p)statement

for a pointer p is equivalent to

if(p!=0)statement

, the corresponding assertion holds for the ?:-operator and
iteration statements.

T*const p; declares a constant pointer (it cannot be
changed after initialisation).

T const*p; declares a read-only pointer (it cannot be used
to write to the object whose address it referss).

T const*const p; a constant read-only pointer.

A pointer to void has the type void*, it cannot be used
with the above pointer operators * and +, but can be
used where an object of pointer type T* is expected
and can also represent a value of any other pointer type.

Explicit pointer type conversions can be done using the
cast operator, but are not recommended for beginners.

There is no portable string representation of pointer
values, but an implementation might print an
implementation-specific representation of a pointer value
when the format specifier %p is used with a pointer to
void.

One can only use and derefer pointer values when reasonable,
they need to refer to certain reasonable locations, such as
declared or allocated objects or certain special places
(just behind an array), and one can only derefer pointers
referring a declared or allocated object.

For two pointers p and q, when reasonable, the
difference p-q is defined and has type ptrdiff_t of the
<stddef.h> header, so that for an array a the difference
&a[j]-&a[i] has the value j-i of this type.

+ and - with pointers are called address arithmetics.

The value of a string literal is a pointer referring its
first char, and has type char const*.

A pointer to a function represents that function as a
pointer. it cannot be dereferred or used with address
arithmetics or combined with object pointers. When f
names a function, &f is a pointer to that function and
can be used instead of f in calls.

Reply With Quote
  #6 (permalink)  
Old 06-25-2012, 06:54 AM
Joe.
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer


"rammy" <nospam@nospam.com> wrote in message
news:js8275$cpo$1@speranza.aioe.org...
> Hi
>
> I need to learn C for numerical analysis as part of my Masters research.


Fucking liar.

>
> I already have quite a lot of experience with BASIC


OK, then NO experience. Noted. One must ask, WTF are they teaching in
"universities"? (been there, done that, don't like 'em).

> (my progression was GW
> BASIC -> QBASIC -> Visual BASIC -> VB.net) so I want to find an
> introductory book on "C for BASIC programmers".


You should forget about programming and get into some labor job or politics
at minimum wage. Thinking is not your forte.

>
> I looked through the campus bookstore


And she rejected you cuz she saw you as the dud you are?

> and didn't really find anything.


Disallusionment.

> Can you recommend some learning materials that will leverage my existing
> programming knowledge?


You don't have any programming knowledge.

>
> Thanks in advance!


Fuck you beforehand.


Reply With Quote
  #7 (permalink)  
Old 06-25-2012, 06:55 AM
Joe.
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer


"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).


Reply With Quote
  #8 (permalink)  
Old 06-25-2012, 07:05 AM
Joe.
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer


"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.


Reply With Quote
  #9 (permalink)  
Old 06-25-2012, 07:10 AM
Joe.
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer


"Stefan Ram" <ram@zedat.fu-berlin.de> wrote in message
newsointers-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?


Reply With Quote
  #10 (permalink)  
Old 06-25-2012, 07:19 AM
David Brown
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

On 24/06/2012 23:52, 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?
>
> Thanks in advance!
>


Do you have to use C? There are other languages that might be a better
choice - Python with SciPy / NumPy comes to mind - then you can
concentrate more on the numerical analysis, and less on the details of
programming.


Reply With Quote
  #11 (permalink)  
Old 06-25-2012, 07:50 AM
Malcolm McLean
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

בתאריך יום ראשון, 24 ביו*י 2012 22:52:37 UTC+1, מאת rammy:
> 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".
>

Everything works in C more or less as you would expect, with a few exceptions.

Types are strict. So a variable must be either a double-precison float, or a single precision float, or an integer, and so on. There's not much intelligent mixing of types.

You declare structures to create compound types,a nd this is used heavily.

Strings are just arrays of chars.

Virtually everything is a function. C itself just does logic. There's no real difference between a built-in fucntiona nd one you write yourself. So there's no print statement, instead you call a function.


Pointers are the heart of C, and the thing that C does rather differently to other languages. Pointers are essentially raw memory addresses, Peek and Poke in old-fashioned Basic. Basically a C program consists of passing about pointers, and reading and writing to them, doing calculations and moving data about in memory.

malloc() is very heavily used. Usually you won't know the length of an array at compile time. So you malloc() a block of memory to use for the array. Also you often use malloc() to create structures like trees and linked lists.
Reply With Quote
  #12 (permalink)  
Old 06-25-2012, 08:20 AM
Weland
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

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
Reply With Quote
  #13 (permalink)  
Old 06-25-2012, 10:15 AM
Rui Maciel
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

David Brown wrote:

> Do you have to use C? There are other languages that might be a better
> choice - Python with SciPy / NumPy comes to mind - then you can
> concentrate more on the numerical analysis, and less on the details of
> programming.


For numerical analysis, if it's not possible to use Fortran then the next
best option is plain old C.

And numerical analysis boils down to details of programming, as the main
purpose is to squeese as much computational juice out of a computer as
possible. You don't get that by simply toying with algorithms. Hence,
Fortran and C being the standards for real world number crunching
applications.

Even if a user wants to toy around with numerical analyis stuff without
having to look too much under the hood, Python is still not an adequate
option; there is Matlab/Octave for that.


Rui Maciel
Reply With Quote
  #14 (permalink)  
Old 06-25-2012, 10:30 AM
Ronald Benedik
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

"Rui Maciel" schrieb im Newsbeitrag news:js9dn4$62l$1@speranza.aioe.org...

David Brown wrote:

> Do you have to use C? There are other languages that might be a better
> choice - Python with SciPy / NumPy comes to mind - then you can
> concentrate more on the numerical analysis, and less on the details of
> programming.


>For numerical analysis, if it's not possible to use Fortran then the next
>best option is plain old C.


I would not recommend the old version of C, but the C99 Standard instead.
Complex Numbers are important for quantum Physics applications.
Also to mention is the complex eletric current.

>And numerical analysis boils down to details of programming, as the main
>purpose is to squeese as much computational juice out of a computer as
>possible. You don't get that by simply toying with algorithms. Hence,
>Fortran and C being the standards for real world number crunching
>applications.


Numerical Analysis is not the Analysis of Algorithms.

Next, what difference between Fortran 2008 and C?
New Fortran standards introduce features as operator overloading and
object oriented Programming. C99 does not do that: C++ does the job.
Reply With Quote
  #15 (permalink)  
Old 06-25-2012, 10:38 AM
Jorgen Grahn
Guest
 
Posts: n/a
Default Re: Learning C as an existing programmer

On Mon, 2012-06-25, Rui Maciel wrote:
> David Brown wrote:
>
>> Do you have to use C? There are other languages that might be a better
>> choice - Python with SciPy / NumPy comes to mind - then you can
>> concentrate more on the numerical analysis, and less on the details of
>> programming.

>
> For numerical analysis, if it's not possible to use Fortran then the next
> best option is plain old C.


Over at comp.lang.c++ they say it's C++.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:57 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.