On Thu, 2007-10-25 at 23:19 +0200, Harald Schmalzbauer wrote:
Am Donnerstag, 25. Oktober 2007 20:22:26 schrieb Aryeh M. Friedman:
Absolutely. (I just didn't mention it before because
obviously Harald already has a beginner's book on the
C programming language.)
Herald does in fact
Harald Schmalzbauer wrote:
#include stdio.h
void main()
That's not a C program. :-)
The return value of the main function of a valid C program
must be int. And of course, your main function should
end with return 0; or exit(0); (the latter requires
#include stdlib.h at the top).
By
On Thu, Oct 25, 2007 at 05:02:00PM +0200, Oliver Fromme wrote:
Harald Schmalzbauer wrote:
#include stdio.h
void main()
That's not a C program. :-)
The return value of the main function of a valid C program
must be int. And of course, your main function should
end with
In response to Oliver Fromme [EMAIL PROTECTED]:
Harald Schmalzbauer wrote:
#include stdio.h
void main()
That's not a C program. :-)
The return value of the main function of a valid C program
must be int. And of course, your main function should
end with return 0; or
Erik Trulsson wrote:
Oliver Fromme wrote:
By the way, I recommend you get a copy of the C standard
and use it for reference. You can buy a digital copy (PDF)
at http://webstore.ansi.org/ (Search for 9899-1999),
it's $30. Alternatively ask Google for C99 draft to get
a free
On Thu, 25 Oct 2007 17:22:11 +0200
Erik Trulsson [EMAIL PROTECTED] wrote:
For a beginner the standard itself is probably a bit too heavy-going.
The book usually recommended is 'The C programming language, Second
edition' by Kernighan and Ritchie.
( http://cm.bell-labs.com/cm/cs/cbook/ )
Yes,
Absolutely. (I just didn't mention it before because
obviously Harald already has a beginner's book on the
C programming language.)
Herald does in fact have one that sucks (it does a terrible job on type
sizes for example [doesn't mention that they may very on different
machines])...
On 2007-10-25 Bill Moran wrote:
In response to Oliver Fromme [EMAIL PROTECTED]:
Harald Schmalzbauer wrote:
#include stdio.h
void main()
That's not a C program. :-)
The return value of the main function of a valid C program
must be int. And of course, your main
Am Donnerstag, 25. Oktober 2007 20:22:26 schrieb Aryeh M. Friedman:
Absolutely. (I just didn't mention it before because
obviously Harald already has a beginner's book on the
C programming language.)
Herald does in fact have one that sucks (it does a terrible job on type
sizes for
On 2007-10-23 23:24, Harald Schmalzbauer [EMAIL PROTECTED] wrote:
Thanks all,
here was my example, just for completeness, I found mentors for my
needs.
#include stdio.h
void main()
{
short nnote;
// Numerischen Notenwert einlesen
printf(Bitte numerischen Schulnotenwert eingeben:
On Tue, 23 Oct 2007 20:44:52 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
The first one was for example the attached code: Why does it segfault?
Mailman ate the attachment... Can't see it here.
-cpghost.
--
Cordula's Web. http://www.cordula.ws/
In response to cpghost [EMAIL PROTECTED]:
On Tue, 23 Oct 2007 20:44:52 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
The first one was for example the attached code: Why does it segfault?
Mailman ate the attachment... Can't see it here.
I may be out of line, but I think if you're
Am Dienstag, 23. Oktober 2007 22:24:54 schrieb Bill Moran:
In response to cpghost [EMAIL PROTECTED]:
On Tue, 23 Oct 2007 20:44:52 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
The first one was for example the attached code: Why does it segfault?
Mailman ate the attachment...
Am Dienstag, 23. Oktober 2007 23:24:09 schrieb Harald Schmalzbauer:
[*snip*]
Although, you'll have to include your code inline to get past the
sanitizers.
Thanks all,
here was my example, just for completeness, I found mentors for my needs.
Thanks a lot to all!
#include stdio.h
void
At 04:24 PM 10/23/2007, Harald Schmalzbauer wrote:
Am Dienstag, 23. Oktober 2007 22:24:54 schrieb Bill Moran:
In response to cpghost [EMAIL PROTECTED]:
On Tue, 23 Oct 2007 20:44:52 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
The first one was for example the attached code: Why
On Tue, 23 Oct 2007 23:24:09 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
#include stdio.h
void main()
{
short nnote;
^
// Numerischen Notenwert einlesen
printf(Bitte numerischen Schulnotenwert eingeben: );
scanf(%d,nnote);
^
I found that declaring
Derek Ragona wrote:
At 04:24 PM 10/23/2007, Harald Schmalzbauer wrote:
Am Dienstag, 23. Oktober 2007 22:24:54 schrieb Bill Moran:
In response to cpghost [EMAIL PROTECTED]:
On Tue, 23 Oct 2007 20:44:52 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
The first one was for example the
cpghost wrote:
There's a mismatch here: scanf(%d, ...) expects a pointer to int,
while nnote is a pointer to a short. Normally, an int occupies more
bytes in memory than a short (typically sizeof(int) == 4 on 32bit
platforms, and sizeof(int) == 8 on 64bit platforms; while typically
On Tue, 23 Oct 2007 23:36:40 +0100
Bruce Cran [EMAIL PROTECTED] wrote:
cpghost wrote:
There's a mismatch here: scanf(%d, ...) expects a pointer to int,
while nnote is a pointer to a short. Normally, an int occupies more
bytes in memory than a short (typically sizeof(int) == 4 on 32bit
Am Dienstag, 23. Oktober 2007 23:24:09 schrieb Harald Schmalzbauer:
#include stdio.h
void main()
{
short nnote;
// Numerischen Notenwert einlesen
printf(Bitte numerischen Schulnotenwert eingeben: );
scanf(%d,nnote);
man 3 scanf (most important thing to look at with any such
Bruce Cran wrote:
cpghost wrote:
There's a mismatch here: scanf(%d, ...) expects a pointer to int,
while nnote is a pointer to a short. Normally, an int occupies more
bytes in memory than a short (typically sizeof(int) == 4 on 32bit
platforms, and sizeof(int) == 8 on 64bit platforms; while
On Tue, 23 Oct 2007 23:24:09 +0200
Harald Schmalzbauer [EMAIL PROTECTED] wrote:
#include stdio.h
void main()
{
short nnote;
// Numerischen Notenwert einlesen
printf(Bitte numerischen Schulnotenwert eingeben: );
scanf(%d,nnote);
switch (nnote)
{
case 1: printf(Die
22 matches
Mail list logo