My dream begin....since 2 days i learning C

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Hello at all my friends :D

Since 2 days i'm the more happy programmer of the world.... see my teeth :mrgreen:

Because since twenty years i dream to programming in C, and never dare to try :oops:
So thanks to PB, now i can begin to learn the C 8)

I'm very surprising to see, how my god have keep the format of the C for do his baby :shock:
Sometime...i believe i'm in my favorite language, but no....i'm in C :mrgreen:

I see the same things (Callback, API with no declaration like loving PB, etc ...) 8)
Yes, C is apparently much more difficult than PB, but FRED is a love, and he not want create another owner language, for make loose his clients in all this personals functions 8)

So i want to continue my project of a PB2C translater... :D

http://www.purebasic.fr/english/viewtop ... 37#p316737

Someone say that perhaps FRED can easily export C code of his compiler, i don't know if it's true ???

I know that nobody have interesting by that :cry: , and everybody laugh when i propose that, but if i can translate 60% of PB, i'm not forcing to remember the complex syntax of the C, and just programming in PB for making C code or PB Code :D

So for do that, i need a little bit of help of my PB friends who know C :wink:
I'm actually on a C forum, but sometime ....your advice is very very important for little KCC 8)

Well ..when i have a question, i put it here, and if one or several member have the kindness to help me a little bit, i can perhaps do my children DREAM 8)

Thank you very much in advance 8)
Kcc the eternal programming dreamer
:oops:
Last edited by Kwai chang caine on Sun Oct 31, 2010 6:56 pm, edited 4 times in total.
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Believe you it's dangerous to put the SWITCH on the While/Event loop ??

Code: Select all

while (GetMessage(&msg, NULL, 0, 0))
    {
       TranslateMessage(&msg);
       DispatchMessage(&msg);
    }
Because apparently the callback is the first way for detect windows events in C

But i want to know if, i can do like in PB...
Use the Event loop for the simple Event and remove the CALLBACK procedure...and just use callback, if i want numerous event or quick event
ImageThe happiness is a road...
Not a destination
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: My dream begin....since 2 days i learning C

Post by utopiomania »

? Are you talking about C#, C++, or just plain C? If its the latter, stick to Basic instead.
I programmed in C, and fell into the trap of writing code so elegant I cant't comprehend
what it was supposed to do anymore. :oops:
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Hello UTOPIOMANIA :D

I talk about the one, alone and big C
C like Creator and base of nearly all what is exist like language 8)
ImageThe happiness is a road...
Not a destination
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: My dream begin....since 2 days i learning C

Post by utopiomania »

Ok, the big C, nothing less. Cool, and good luck to you! :)

My C codes is on a 20cm high stack of 3.5" disks, so I can't help you with any examples right now.

Actually, they just caught fire. I hate C, I think. Anyways, good luck.
Last edited by utopiomania on Sun Oct 31, 2010 10:01 pm, edited 1 time in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

My C codes is on a 20cm high strack
You can when even say your advice for my question if you have do C, about the loop of event ????
Is it possible or not to put directly the Switch inside ???
Anyways, good luck.
Thanks, i believe i need much much chance, you have right :lol:
So when i know nothing in PB, and less in C....it's a real adventure
The advantage with me, it's i'm not affraid because i don't know anything :oops:
It's the advantage of the uncultivated :mrgreen:

I begin just to write the first function to translate "Enumeration" :lol:
The baby is again in my belly....i can even say...the ovule is again in my belly, that the more correct word :lol:

I want do function after function, first with the more simple...and even if i can not terminate all, and the code is translated at 60%, it's already better that nothing no ??? :D

Me i like C....but i love PB and FRED much more....and with the power of PB we always say, we can do all the miracle..
It's the time to proof that :mrgreen:

Thanks to your answer 8)
ImageThe happiness is a road...
Not a destination
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: My dream begin....since 2 days i learning C

Post by Vera »

Dear Kwaï chang caïne,
I wish good success with your joyful jump into C Image

If you like to have a large repository of well garded running code examples in direct comparison, then have a look at RosettaCode (scroll down and choose one of the challenges). There you'll find PureBasic represented with already 341 solved solutions and C with 365.

(Tip: there's also a hard to come upon special page: Basic language learning)

nice greetings ~ Vera
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: My dream begin....since 2 days i learning C

Post by Mistrel »

All my "C" code is in "C++". You're on your own, Kwaï.

Image

Good luck.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: My dream begin....since 2 days i learning C

Post by c4s »

Mistrel wrote:All my "C" code is in "C++". You're on your own, Kwaï.

Image

Good luck.
Finally you found a good situation for this smiley. :mrgreen:
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: My dream begin....since 2 days i learning C

Post by Mistrel »

c4s wrote:Finally you found a good situation for this smiley. :mrgreen:
I thought it was pretty clever as well. :)

It was Vera's emoticon that gave me the idea.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

@VERA
Thanks for the link, i have forgotten the rosetta way 8)
I take a look also to the other link :wink:

@MISTREL
It's a pity :cry:
I believe there are much member who know the C in this forum :cry:

I continue alone like usually :(

Thanks when even for your answer 8)
I wish at you two a good day :D
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

In fact the real question is :

Do you think that FRED use when even and in all case, the Callback when he have created the function

Code: Select all

Repeat  
  
 Evenement = WaitWindowEvent()
  
 Select Evenement
  
  Case #PB_Event_Gadget
    
   EvenementGadget = EventGadget()
     
 EndSelect
   
Until Evenement = #PB_Event_CloseWindow
ImageThe happiness is a road...
Not a destination
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Re: My dream begin....since 2 days i learning C

Post by milan1612 »

Kwaï chang caïne wrote:

Code: Select all

while (GetMessage(&msg, NULL, 0, 0))
    {
       TranslateMessage(&msg);
       DispatchMessage(&msg);
    }
Seeing this piece of code I can't resist giving you some advice.

What you're writing here is C like it's being used in the Windows API. You shouldn't use
the Windows API when you're just about to learn C. The Windows API is one of the ugliest
pieces of C code I've ever seen. It won't teach you good C programming.

You really should start to learn the language first, then the libraries. Write a small
console application without using anything but the standard C libraries. Become famliliar
with common patters used in C programs.

I fell for this trap too, trust me...


Or better yet, learn C++ from the start :wink:
Windows 7 & PureBasic 4.4
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Thanks to your advice MILAN1612

I know you have right :oops:
But my goal is to can create my translater PB/C
And especially how create a windows with API

But in the same time, i learn a little bit the C, and especially how use IDE VC6++

It's a hard works especially for little KCC, i move slowly, but i move.
If i like do the C, obviously i continue to learn with good method.. :wink:

And i want to stay in C, not C++, i don't like POO too, it's for this reason that i love and use also PB, i just like procedural programming 8)

I know KCC do always all the things back to front :oops:
I hate the console, and never do something with it, even in PB

I know i have wrong, but if i don't see a windows ..i'm sad :lol:
It's a reason why, i never use linux too :oops:

Thanks to your advice very important for me 8)
At the pleasure to read you
ImageThe happiness is a road...
Not a destination
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: My dream begin....since 2 days i learning C

Post by LuCiFeR[SD] »

Grasshopper my old friend... Do not run before you have learned to walk :P
Post Reply