Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Anyone know any C++? I want to learn some but I need a teacher

Author
Message
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 21st Mar 2004 06:38
Hi...
I was gonna try to code some dll's for dark basic pro. I have a copy of Dev C++ and I have created the dll that is in the dbp help file.

I dont know what any of the commands are. Can someone help me out. I want to be taught c++ like I was db.

Please help me
Nicolas

HZence
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 21st Mar 2004 06:40
Okay, try this if you have a compiler




Team EOD :: Programmer/Storyboard Assistant
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 21st Mar 2004 07:02
I'll try it but I kinda wanna know what everything does....

I have no clue what command does what.

Please get back to me
Nicolas

TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 21st Mar 2004 18:22 Edited at: 21st Mar 2004 18:57
Ill write one up for you real quick....

Hold one sec...

*pause*

back...



Amist the Blue Skies...
Elleomea
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location: England
Posted: 21st Mar 2004 18:41 Edited at: 21st Mar 2004 18:44
Commented version of HZence's thing:



Personally I'd recommend getting a good book, like Thinking In C++. Or even better, finding a good C++ course nearby (try local colleges, etc.).
C++ isn't as easy a language to teach or learn as DarkBasic, I doubt you'll find anyone willing to commit the massive amounts of time necessary to educate someone with no C++ knowledge.

So you'll really either need to do what I've done, which is teach yourself; then you can ask people for help on specific things you don't understand. Or attend proper lessons in C++.

How much ham could a hamster stir, if a hamster could stir ham?
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 21st Mar 2004 19:14
I own:
SAMS Teach Yourself Visual C++ 6 in 21 Days

The book doesnt really explain commands very well.

And it especialy doesnt explain the string tables needed for connecting the dll code into dbp.

Um I will see what I can do.

But I dont really know what void and pString and LSTR stuff is. I think that maybe if I know what those are I would have an easier time.

Thanks
Nicolas

TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 21st Mar 2004 19:23 Edited at: 21st Mar 2004 19:24
Quote: "void"

Means..."nothing". basically used in function definitions when you want a function that dosent return anything.

Quote: " LSTR "


THink that means long string...

Quote: "pString"

think that means pointer of a string

Amist the Blue Skies...
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 21st Mar 2004 19:54
Thats what they mean but how do you use them?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Mar 2004 22:49
A totally *free* pair of downloadable books - http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 21st Mar 2004 22:50
Ill try to remember...

void: you use void when you DONT want a function to return a value... for instance




LSTR:

long-string; this is a variable type like integer, float, sting etc etc. so you would use it to define a variable or function return type...

variable


function


pString:

pointer to a string... I don't think im going to explain this one. ITs rather complicated. Unless you already know some thing about pointers. Pointers are basically arrays, except you can change the address of a pointer.

Amist the Blue Skies...
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 21st Mar 2004 22:51
i never got what pointers are. what are they?
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 21st Mar 2004 22:55 Edited at: 21st Mar 2004 23:04
sigh... I guess I can explain them...

Pointers are similar to arrays in nature. Arrays are alloted portions of memory (which cannot be changed once casted). Pointers work like arrays but the address or starting point of a pointer can be changed. What pointers do is point to an address to a variable or array.

pointers are usally denoted as '*'
Im going to show the examples in C (thats the only launguage ive used pointers)



(btw can someone tell me if im doing it right? might be a bit rusty.)

anyways, the ptr is getting assigned the the address of array at position [0]. So if we wanted to print the value of ptr at index [0] it would be the same as array[0]

we could also move up the array...


now the value of ptr at index [0] is the value at array[5]

As you can see, pointers are very powerful if used right...

Amist the Blue Skies...
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 24th Mar 2004 03:52
so, their kinda like variables for arrays ?
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Mar 2004 04:04
STFU N00B! I mean, they can be if you look at them that way

Always have, never will =)
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 24th Mar 2004 06:32 Edited at: 24th Mar 2004 06:34
Quote: "so, their kinda like variables for arrays ? "

kinda, you can still move up and down the array.

It dosent hold just "one" value.

Ill try to explain again. You can think of pointers as the "starting value". You can change the starting value to anything on the array; for instance you can make the starting value of ptr = array[4]. This means that the value of ptr[0] = the value of array[4] and the value of ptr[1] = the value of array[5].

Amist the Blue Skies...

Login to post a reply

Server time is: 2024-09-21 13:41:42
Your offset time is: 2024-09-21 13:41:42