HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

C++/C User Q&A Here

08-10-2004, 10:13 PM#1
COOLer
Im happy that there is finnaly a programming Fourm I sugested this a long time ago to the staff . Becasue i know alot of C/C++ as well as active programmer I am willing to try anwser any qestions on C/C++ . Please no quistions on None standard libs and api such as Open gl ect.
08-13-2004, 12:39 AM#2
Extrarius
Quote:
Originally Posted by COOLer
Im happy that there is finnaly a programming Fourm I sugested this a long time ago to the staff . Becasue i know alot of C/C++ as well as active programmer I am willing to try anwser any qestions on C/C++ . Please no quistions on None standard libs and api such as Open gl ect.
For people that want help on any kind of game development topic (programming, graphics, etc), GameDev.Net is an excellent resource.
08-14-2004, 02:51 AM#3
Toxicseaweed
i've tried learning C++ and know arrays,undefined loops,increments, variables, constants. The basic balony. The problem is after learning a bit I cannot figure a way to test and prove to myself i know my new skills. If there had been some sort of teaching group where there would be 1 assignment then a bunch of people would get together and work on it individually, bringing back their product and comparing it in forum form.
08-14-2004, 06:30 AM#4
Ceo
Toxic try making a little text RPG.
08-14-2004, 05:13 PM#5
Extrarius
Toxicseaweed: If you read through posts and articles on GameDev you'll be able to fill in a lot of the blanks, and anything you still cant figure out you could make a post on. There are quite a few knowledgeable people there.

nathanmx: Why would you expect anybody here to know how to program when 99% of the population either doesn't know what jass is or is deathly afraid of it?
08-15-2004, 11:43 AM#6
Eff_X
It's easy to explain: A lot of people bought War3, a lot of them played around with the editor, but only some of them have already done some programming ... ^_^ so this is why a lot of people are also posting here but never have written any code ... and only a few (mostly mods of this forum) are realy expirienced ... :(

I also have done lots of little programming things with different languages e.g.: c++, java, pascal :> but i would still say i'm a noob, because i know the basics but don't have any deep knowlegde in one of these languages ... :(
08-15-2004, 06:27 PM#7
COOLer
one Good way to get the most out of programing is to learn to read and write files that by its will help alot. Reading and writing files is truly an art worth learning. Anthor good way to get more out of programing is OOP learn how to make classes and make them extended others and call them. But be warned once you go OOP you dont want to go back you will want to make everything a class or sturcture.
08-18-2004, 09:19 AM#8
Eff_X
Well I already worked with files, but in c++ and pascal it was not more then writing some words into it and read them again ... ;)
In Java i already used an xml file to read entrys of an zipfile (which could have zip files into it again and again ... ) and change them to save it in another zipfile ... ;) But it was as easy as baking a cake ... ^_^
Therefore I also needed classes for sure, but I always fall back to the not OOP way ...
08-18-2004, 09:38 PM#9
COOLer
Speaking of C++ I found a neat little way of passing a function to a function using pointers.

#include <iostream>


using namespace std;

int f( int i){ return i*10; }
int G( int i){ return i*12; }


void test( int (*Point) (int),int a){
int val = Point(a) ;
cout<<val<<endl;
}



int main(){

test(&f,5);
test(&G,5);
system("pause");
}
08-19-2004, 02:34 PM#10
Eff_X
I think I'll understand it if you could explan the meaning of " int (*Point) (int)," ;)

*Point is a pointer on Point, ok
(int) is an type cast to int, ok
but all together ??? o_O
08-19-2004, 09:24 PM#11
COOLer
void test( int (*Point) (int),int a){
int is passed function return type
*Point is casting the pointer to a function at address point
int is a dummy used for the parameters of *Point
int a is a normal part of the first function which I use to pass the passed functions Parameters.
08-20-2004, 09:29 AM#12
Eff_X
Well, I understand! :) Very nice!
I still can't invent such things ... ;) How do you came to this solution?
08-20-2004, 01:40 PM#13
Mythmon
i have another question to add to his, what use are pointers? i never really got in to c++ much i so i wouldnt know, i prefer Java or actiponscript(the flash scripting lanquage), but im not very good at either
08-20-2004, 09:38 PM#14
COOLer
poiters are one of the most powerful things in programming java uses poiters but they are in the java vertural machine.

pointers point to a memory address

int main(){
int fl =0; // fl val is set to 0
int *p = &fl; // memory is set to fl what ever fl is p will now be.
cout<<p<<endl; //some Big hex number adress of fl
cout<<*p<<endl; // the value of fl is 0 so p is 0
fl =3;
cout<<p<<endl;//some Big hex number adress of fl
cout<<*p<<endl;// the value of fl is 3 so p is 3
system("pause");
}
with this you could scan a systems ram and save poiters of objects not the object itself thus saving space .


To let you all know the 2 best C++ editors i have found are Visula Studio C++
and Dev C++ Dev is free and is more anci complient. Or you could just dl the free g++ and use notepad . o_O
08-21-2004, 04:17 PM#15
Mythmon
oh, that makes sense now

oh and if you were talking to me about the compilers i already have Dev C++, i just could never get into c++

you said something about pointers in java, do you mean that they are only used by the VM and you cant use em in code or that you have to proggram differently to use them? im just curiuos