Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Learning C as an existing programmer

Reply
Thread Tools

Learning C as an existing programmer

 
 
rammy
Guest
Posts: n/a
 
      06-24-2012
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
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      06-24-2012
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
 
 
 
 
Charles Richmond
Guest
Posts: n/a
 
      06-24-2012
"Ian Collins" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
Ben Bacarisse
Guest
Posts: n/a
 
      06-25-2012
rammy <(E-Mail Removed)> 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
 
Stefan Ram
Guest
Posts: n/a
 
      06-25-2012
"Charles Richmond" <(E-Mail Removed)> 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 ?perator 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
 
Joe.
Guest
Posts: n/a
 
      06-25-2012

"rammy" <(E-Mail Removed)> wrote in message
news:js8275$cpo$(E-Mail Removed)...
> Hi
>
> I need to learn C for numerical analysis as part of my Masters research.


****ing 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!


**** you beforehand.


 
Reply With Quote
 
Joe.
Guest
Posts: n/a
 
      06-25-2012

"Ian Collins" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
Joe.
Guest
Posts: n/a
 
      06-25-2012

"Charles Richmond" <(E-Mail Removed)> wrote in message
news:js87rt$nd9$(E-Mail Removed)...
> "Ian Collins" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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 ****ing "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
 
Joe.
Guest
Posts: n/a
 
      06-25-2012

"Stefan Ram" <(E-Mail Removed)-berlin.de> wrote in message
news(E-Mail Removed)-berlin.de...
> "Charles Richmond" <(E-Mail Removed)> 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
 
Malcolm McLean
Guest
Posts: n/a
 
      06-25-2012
בתאריך יום ראשון, 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
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent positions: Sr Programmer Analyst (SPA) and Programmer Analyst(PRA)-06+month's- Carson City, NV. Isaac Java 0 12-08-2010 05:34 PM
Who gets higher salary a Java Programmer or a C++ Programmer? Sanny Java 391 01-06-2010 02:48 AM
Who gets higher salary a Java Programmer or a C++ Programmer? Sanny C++ 396 12-17-2008 06:13 PM
Existing Dll - using Functions from an existing dll Tristin.Colby@gmail.com Ruby 0 02-05-2008 07:38 PM
Why no existing Java type to existing XML schema binding support? nrm Java 3 04-10-2006 04:52 PM



Advertisments