[Coco] C language

Salvador Garcia salvadorgarciav at yahoo.com
Fri Nov 22 11:29:29 EST 2019


 Thanks Joel.

My objective is to prepare for a project which I hope to start in 2020. It is CoCo related in that it involves interfacing an Arduino, hence the desire to better learn the language.

I am hesitant to post my C questions here because they might be considered off topic since the question would not directly involve a CoCo.

Presently, I am working on algorithms to convert a relative file path to an absolute one, given the current working directory. This is to manage files on an SD card attached to the Arduino which in turn would be attached to a CoCo. Yes, I know, there are better solutions, like the (vastly) superior CoCo SDC, but I want to use this as an exercise to better understand the C language, the Arduino and of course, the CoCo's disk handling logic. Call it an academic exercise.

The research I've done tells me that I need to use either char arrays or strings where many favor the use of char arrays. Although I don't see a distinction between the two (a string is a null terminated char array), I suspect that it has to do with the libraries used.

I've also started doing some research into the Arduino SD library and it may that my problem may be easily solvable by using the SD library's functions. I haven't gotten that far yet (doing that now), so I can't be sure of this. But if I can use the library, instead of manually parsing the given path then worrying about char arrays and strings is moot.

As originally mentioned, I would like to eventually migrate my C skills towards CMOC. If there are no objections I will post my C questions here, of course after due diligence on my part :-). Salvador



    On Friday, November 22, 2019, 06:56:31 AM CST, Joel Rees <joel.rees at gmail.com> wrote:  
 
 Well, post what you're having trouble with and some of the people
(including me) here can help you untangle things. That may be quicker than
starting over.

2019年11月15日(金) 3:23 Salvador Garcia via Coco <coco at maltedmedia.com>:

> I've done a fair amount of C programming in the past, but now that I would
> like to take it up again, I find myself struggling with a Hello World
> program and those @s and *s look more like parts of bad words. I've done
> some Arduino programming, but I find that many of my program statements
> look more like the following:
>
> pinMode(LED_BUILTIN, OUTPUT);
>
>
> and
>
> digitalWrite(LED_BUILTIN, HIGH);
>
>
> Not exactly hard core C<g>. I am looking for a good C programming lesson.
> I've searched for these and get some, but many are just Hello World
> tutorials and some take me to C++, java or even (gasp) C#. Sometime in the
> future I would like to get into CMOC for the CoCo, so I am looking for
> material that will get me up to speed on this language.
>
> For example, right now I would like to know how to parse a directory path.
> Looks like a job for char arrays and strings... but I no longer have a
> handle on these. Any recommendations for online material is greatly
> appreciated! I don't mind starting with simple stuff, but would like it to
> go beyond the basics of this language.
>
> Thanks all!! Salvador
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>

-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco
  


More information about the Coco mailing list