Hello Everyone, Very Happy

I have been trying to learn C. so far I know what function are and how to use gfx commands, Thanks to the understanding of ICE. Good Idea But in order for me to fully understand C, I will have to learn from other sources. I also want to learn C because I want to rewrite Xenon in it. Smile
"C is more powerful" - Cemetech users

Questions
  • How does variables work when there is no store sign?
  • Where and how can I use OS commands such as getkey, Etc.
  • How do I use Hook or pointer in C?
I'm a bit scared to answer for fear of steering you wrong, but here it goes.

Alvajoy123 wrote:
How does variables work when there is no store sign?

To give a value to a variable if it has been declared already is as simple as

Code:
x = 5; //OR
x = x + 1;

to declare a variable (before you can use it) you give it a type:

Code:
int x; //stores an integer value;
double y; //stores a real number value;
char c; //stores an ascii character (or just one byte);

you can also give the variable a value while you declare it:

Code:
int x = 0;
double y = 1.25;
char c = 'A';



Alvajoy123 wrote:
Where and how can I use OS commands such as getkey, Etc.

I'm not sure you really can, but there's another C library that lets you access the keypad pretty easily, much like the gfx library makes it easy to do graphics. I don't remember what it's called...


Alvajoy123 wrote:
How do I use Hook or pointer in C?

Pointers in C are pretty fun. You use the & symbol to get a variable's address in memory. This is helpful when you need a function to change the value of a non-global variable. The int* in the function means it's looking at the value at the address passed by the function call, not the address itself.

Code:
int main()
{
  int x = 0;
  addFive(&x);
  return 0;
}

void addFive(int* number)
{
  *number += 5;
}



I hope this helps! and please anybody correct me about anything if it's wrong.
Thanks for the information Smile . I will leave any question here Good Idea
Is C hard to learn? I would like to learn it so I can become useful
I picked up C++ pretty quick when I started learning with arduino. From there I was able to very quickly learn C, C#, Java, Javascript, and Python. I wouldn't say it's that hard to learn.
De2290, I think you should start out with ICE then move to C Smile .ICE is basically C but with a different syntax.
Sorry for nerco-posting, But I've learned C! Razz
Congrats! Doing any cool projects?
theprogrammingcube wrote:
Congrats! Doing any cool projects?


Yeah! Check them out here: https://www.cemetech.net/forum/viewtopic.php?t=17690&start=0

I have some on the way that aren't on the page I'll be posting them soon Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement