Welcome, Guest. Please login or register.

Author Topic: I don't think I can learn C....  (Read 10432 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: I don't think I can learn C....
« Reply #44 from previous page: April 03, 2003, 11:47:09 AM »
Quote

whabang wrote:
AARGH! By all gods and somewhat  important deities! :-o :-o  :-o

I was planning to learn C or C++, but this is too much!
/me runs back home to give a big hug to FreePascal :-D


Fear not, for 'tis merely an exmple of confusication - with a capital C :-)

No real program would look like this. Unless part of the Win32 kernel :-D
int p; // A
 

Offline whabang

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 7270
    • Show only replies by whabang
Re: I don't think I can learn C....
« Reply #45 on: April 03, 2003, 11:49:10 AM »
/me sure hopes that you are right :nervous:
Beating the dead horse since 2002.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: I don't think I can learn C....
« Reply #46 on: April 03, 2003, 11:55:04 AM »
Have no fear matey,

C (and C++) is actually one of the most logically laid out languages there is. It's stuctured, terse and flexible. It has very few keywords, all the basic operators you could ever need and everything else is done using functions.

Before anybody starts - the above is true, once you get use to it :-)

I'm gonna be unemployed real soon so that long awaited tutorial site I was considering (see here) may see the light of day :-D
int p; // A
 

Offline Crumpster

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 215
  • Country: gb
    • Show only replies by Crumpster
Re: I don't think I can learn C....
« Reply #47 on: April 03, 2003, 12:36:44 PM »
@ Karlos

Cheers for the update, have read through the backlog now.

How come your losing your job? (I take it you work in Software Development??)

Cheers,

Crumpy
A1-XE - G4 800MHz, 1GB RAM, 80GB HDD, Radeon 9250, OS 4.1
A1200T - PPC603 240MHz / 68040 50MHz, 128MB RAM, Mediator, OS 3.9 / 4.1
A1200 (No. 2) - M-TEC 68030 50MHz, 4GB CF, KS 3.0, OS 3.0
A500 - ACA500 with ACA1232.
CDTV - in Progress: SCSI, 9 pin joy/mouse connectors, KS switcher.

Non-CBM - Atari STe, Atari Falcon, Apple ][e, ZX Spectrum, CPC6128.
Gone but not forgotten (and slowly getting them back): CPC464, C64, Vic-20.

I may have a problem
 

Offline Crumpster

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 215
  • Country: gb
    • Show only replies by Crumpster
Re: I don't think I can learn C....
« Reply #48 on: April 03, 2003, 12:42:35 PM »

Incidentally, I would be interested in that tutorial site.
Can't remember if I piped up before.
I know a tad of C++  (a really ickle bit) so would welcome such a site.
A1-XE - G4 800MHz, 1GB RAM, 80GB HDD, Radeon 9250, OS 4.1
A1200T - PPC603 240MHz / 68040 50MHz, 128MB RAM, Mediator, OS 3.9 / 4.1
A1200 (No. 2) - M-TEC 68030 50MHz, 4GB CF, KS 3.0, OS 3.0
A500 - ACA500 with ACA1232.
CDTV - in Progress: SCSI, 9 pin joy/mouse connectors, KS switcher.

Non-CBM - Atari STe, Atari Falcon, Apple ][e, ZX Spectrum, CPC6128.
Gone but not forgotten (and slowly getting them back): CPC464, C64, Vic-20.

I may have a problem
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: I don't think I can learn C....
« Reply #49 on: April 03, 2003, 01:49:17 PM »
Quote

Crumpster wrote:
How come your losing your job? (I take it you work in Software Development??)


Too much time on amiga.org :-D. Nah, sigh of the times :-(
int p; // A
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: I don't think I can learn C....
« Reply #50 on: April 03, 2003, 03:03:57 PM »
Quote
Quote

Piru wrote:
68000, AmigaOS (SAS/C 6.58):
mystery 1048 ----rwed Today

Anybody beaten this yet?


These with my half-working 68k gcc 2.95.2 setup:

mystery-68000-gcc                  968 ----rwed Today     16:41:16
mystery-68020-gcc                  928 ----rwed Today     16:40:14
2 files - 1896 bytes used

...I wonder if I missed something with SAS/C though, it should gererate smaller code imo.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: I don't think I can learn C....
« Reply #51 on: April 03, 2003, 04:13:29 PM »
Wow, that's pretty titchy!

I guess the 020 code benefits from some addressing optimisations...
int p; // A
 

Offline AtheistTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 820
    • Show only replies by Atheist
Re: I don't think I can learn C....
« Reply #52 on: April 04, 2003, 01:52:29 AM »
I wonder how big the .exe file would be on win32 vs. 68K vs. 68020 (or higher) vs. PPC if it was just one big

printf("On the first day of Christmas my true love gave to me/n
a partridge in a pear tree./n/n
On the second day of Christmas my true love gave to me/n
two turtle dovesin a pear tree./n/n
On the third day of Christmas my true love gave to me/n.......")

I think I got the printf(" ") part right.

I ask because, on win(lose)dohs, if you go to the trouble of writing IMPRESSIVE code, it still bites you in the end.

It is VERY IMPRESSIVE code to me, at any rate.

AmigaOne! Things are gonna get REAL interesting!!!
\\"Which would you buy? The Crappy A1200, 15 years out of date... or the Mobile Phone that I have?\\" -- bloodline
So I guess that A500, 600, 1000, 2000, CDTV, CD32, are pure garbage then? Thanks for posting here.
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: I don't think I can learn C....
« Reply #53 on: April 04, 2003, 05:38:34 AM »
im not sure what that code was... but it reminds me of some code i saw in a magazine once that decoded some kind of DIVX or DVD encoding, that was said to be unbreakable!

ROFL! unbreakable they said...
HAHAH! completly secure they said...

 

Offline N7VQM

  • Sr. Member
  • ****
  • Join Date: Dec 2002
  • Posts: 272
    • Show only replies by N7VQM
Re: I don't think I can learn C....
« Reply #54 on: April 04, 2003, 05:45:50 AM »
Quote

Atheist wrote:

I ask because, on win(lose)dohs, if you go to the trouble of writing IMPRESSIVE code, it still bites you in the end.


One doesn't always get bitten.  

For example, my portion of my senior project was a Win32 program to control WinAmp.  The user interacts with WinAmp thru a touchscreen LCD connected to a serial port via an RF link.  I found similar projects to control WinAmp thru a game port.  The smallest of those I found had a 300KB executable file and all the really did was allow you to send the basic commands like play, stop and FF/RR.  My program gives you control over those plus will send the name of the track playing, navigate playlists (with names) and had rudimentary support for manipulating WinAmp's equalizer.  

Based on the size of the other programs I found, I thought mine would be in the neighborhood of 500KB.  Imagine my and my partners surprize when the final executable was only 28KB.
\\"...an error of 1 is much less significant in counting the population of the Earth than in counting the occupants of a phone booth.\\" - Michael T. Heath, Scientific Computing...
 

Offline N7VQM

  • Sr. Member
  • ****
  • Join Date: Dec 2002
  • Posts: 272
    • Show only replies by N7VQM
Re: I don't think I can learn C....
« Reply #55 on: April 04, 2003, 05:48:10 AM »
Quote

iamaboringperson wrote:
im not sure what that code was... but it reminds me of some code i saw in a magazine once that decoded some kind of DIVX or DVD encoding, that was said to be unbreakable!


You're probably thinking about CSS and DeCSS.  I find it amusing that you can buy a t-shirt with DeCSS in PERL silkscreened on it.  I am a circumvention device....
\\"...an error of 1 is much less significant in counting the population of the Earth than in counting the occupants of a phone booth.\\" - Michael T. Heath, Scientific Computing...
 

Offline Agafaster

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 1175
    • Show only replies by Agafaster
Re: I don't think I can learn C....
« Reply #56 on: April 04, 2003, 09:57:07 AM »
All for a good cause, too - top of the Group !

anyway, we are here to talk about one of me other favourite topics - C.

I had a go tidying up (ie: reformatting in an attempt to make more readable) the 1st program.
I came across summat I hadnt seen before there, and in Piru's program too - the use of a Comma. what does this signify ?
In particular for Piru's program in the 2nd for loop:

[color=000000]putchar(--l%80?i:10)[/color][color=00ccoo],[/color]o=D=l%80*.05-2[color=00ccoo],[/color]i=31

I presume it means many statements per line or something... :-?
\\"New Bruce here will be teaching Machiavelli, Bentham, Locke, Hobbes, Sutcliffe, Bradman, Lindwall, Miller, Hassett and Benaud.\\"
\\"Those are all cricketers, Bruce !\\"
A1XE G3/800MHz Radeon 7000 512MB
A1200 030/25MHz 8MB
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: I don't think I can learn C....
« Reply #57 on: April 04, 2003, 10:10:32 AM »
It's a sequencing operator - not many C programmers even realise this, using it only to seperate declarations of variables etc.

For example

x = (f(), g());

AFAIR, the value of x is whatever g() returns, but f() is always called before g().

This seems pointless when you could write

f();
x = g();

but it does have it's uses :-)
int p; // A
 

Offline Casper

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 214
    • Show only replies by Casper
Re: I don't think I can learn C....
« Reply #58 on: April 04, 2003, 10:52:04 AM »
Quote
It's a sequencing operator - not many C programmers even realise this, using it only to seperate declarations of variables etc.


It's one of those things the longhaired geeks that sit in the basement all day coding wanted in C so they can write code no one else understands and feel very super-leet.  :-)
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: I don't think I can learn C....
« Reply #59 on: April 04, 2003, 11:27:08 AM »
Hey dude, I got my hair cut 2 years ago. My avatar image just old, that's all :-D

Actually, for C code, the comma operator is often useful in function-like macros that are supposed to 'return' a result and need to do several operations without ending the statement (ie with a semicolon).

A lot less useful in C++ where you just have an inline function.
int p; // A