Hello everyone, I want to start implementing some of my mathematics knowledge into programming through AI. Back 3 months ago I had no idea what is AI, but then I took Machine Learning course on Coursera and finally realized how much maths is included in AI. However I wasn't able to finish the course with good understanding of what is going on in algorithms because I have no idea what are derivates yet, we haven't studied that in school yet ( will do this year ). Now... before we study that, I would like to get familiar with some simpler …

Member Avatar
Member Avatar
+0 forum 4

Hi guys, I haven't been on daniweb for a while, I've started learning scripting in UDK. But still I wish to make smaller games using native languages. So here goes my question: what is the best IDE for programming small games with nice UI? So far, for programming win apps I have used Borland Builder only, and it doesn't seem as a piece of software that is easy to make nice UI with ( no support for PNG kills me ). On the other hand, VC++ seems pretty good for that. My plan is to make a little Dominos game, …

Member Avatar
Member Avatar
+1 forum 3

Hi people, I am making a little experiment to see something. I wished to inherit "string" class and add a function to child class. Function should take a char as parameter and return bool depending on is there such a character in our string or not. I have started off with this, but I got stuck with "this": class MyStringClass:public string{ public: MyStringClass(const char* a):string(a){}; bool isInString(char); }; bool MyStringClass::isInString(char s) { for(int i=0;i<=this->length();++i){ if(s==(*this)[i]) //here return true; } return false; } **this** has type of MyStringClass*? If so, why can't we access to its elements this way: this[i]? I …

Member Avatar
Member Avatar
+0 forum 3

Hi, Do you have any useful explanation of how to create a draggable window? What I wish to say is when you select your window will have no border ( considering that, it cannot be dragged around screen), how to make it draggable, for example by making a certain area in window "sensible" so after user presses that area and moves cursor, it moves window too? I can't remember best, but I think I saw a tutorial on VB about this problem, and he added a panel writing to it some code and making it "sensible" to dragging. Thank you.

Member Avatar
Member Avatar
+0 forum 1

Hi, I need little help with using MediaPlayer from System tab in Borland Builder 6 for C++. Does anyone know what member function of MediaPlayer returns bool variable which tells us is music currently being played or not? I have seen solution for this problem where we use Timer which has frequency which equals the length of song that is being played, so as soon as specified time passes, Timer switches to the next song. But I wish to know is that the only way. Thank you!

Member Avatar
+0 forum 0

Hi, Is anyone familiar with this problem in BorlandBuilderC++: void Print(AnsiString Path){ Label1->Caption=Path.c_str(); } ... Print("C:\Directory1\Directory2\Music.mp3"); When I pass this string to Print(AnsiString) and try to display it in Label1, I lose all '' signs and text in Label1 looks like this : **"C:Directory1Directory2Music.mp3"** Why is this like that? Thank you!

Member Avatar
Member Avatar
+0 forum 2

Hi, I have simple question: how do I make Windows Media Player in BorlandC++ ( an ActiveX component ) plays all songs from specified folder? Thanks.

Member Avatar
+0 forum 0

Hi, There is short explanation of queue at cplusplus.com site which tells that queue should contain front() and back() functions. As I have tested in VC++, if I use queue from <queue> and call any of these functions for an empty queue, program crashes. Could this problem be solved by simply adding a throw, in case when queue is actually empty, so front and back would throw an exception which'd be caught by try block? ( of course I am talking about queue, one would create, as I have done) Here is my simple solution of this problem. struct Exception{ …

Member Avatar
Member Avatar
+0 forum 3

Hi, Can you tell me how can I make my application recognizes when the user presses a button on keyboard? *For example*: presses 'S', application prints "Hello.". I need this information for BorlandC++, but it would be useful even though you provide the same for VC++ :) *(I am not talking about console applications, I need these tips for GUI apps )* Thank you!

Member Avatar
Member Avatar
+0 forum 6

Hi, I am learning queues and I have found 2 examples. Both examples represent queues with limited size, for example 30. But <queue> allows us to create queue that is not limited by ***pre-set** queue size. Can anyone explain me how have they created something like that? Thanks! ***By *pre-set* I wanted to say that we have set the queue size during its initialization. Like when we create the arrays.**

Member Avatar
Member Avatar
+0 forum 2

Hi, I have read this on IBM: > > An exception specification may only appear at the end of a function declarator of a function, pointer to function, reference to function, pointer to member function declaration, or pointer to member function definition. An exception specification cannot appear in a typedef declaration. The following declarations demonstrate this: Can anyone write me an example of **reference to function** (so it contains exception specification with it)? And another question about syntax I can't understand. What does this mean: void h(void i() throw(int)); Thanks.

Member Avatar
Member Avatar
+0 forum 3

Hi, I have read something on IBM's site about exception specification and pointers to functions: void (*f)(); void (*g)(); void (*h)() throw (int); void i() { f = h; // h = g; This is an error. } IBM says: > The compiler allows the assignment f = h because f can throw any kind of exception. The compiler would not allow the assignment h = g because h can only throw objects of type int, while g can throw any kind of exception. But I tested the code in VC++, DEVC++ and CodeBlocks, no error anywhere. Any explanations? Thanks.

Member Avatar
Member Avatar
+0 forum 2

Hi, I have been playing around with pointers and made a little mistake of this type: class D{ public: int a; }; int main() { D *x; //As you can see I didn't allocate memory at all... x->a=3; // ... but initialized a member variable cout<<x->a<<endl; return EXIT_SUCCESS; } I get run-time error if compiled in DEVC++. **But I tried the same in Code::Blocks, and it works**, as if I regularly allocated memory before initializing... hm... what? Can anyone explain me this behaviour, I know some rules differ from compiler to compiler, but what's the matter with this one? Thanks!

Member Avatar
Member Avatar
+0 forum 1

Hi, I've been searching around about DLLs and I can't get what they actually are. Why do we need .cpp, .h and .dll file and how do we link it using CodeBlocks? I used tutorials to create DLL files, and it was successful, they contained 2 functions, but linking is the problem. If anyone could explain me this process or even theoretical part of linking DLL files. If I could manage to create a DLL and call it in simple hello world program, I think I will understand it much better. Thanks!

Member Avatar
Member Avatar
+0 forum 1

Hi, I have recently finished first game in C++ which has huge code which will be fixed in future who knows how many times. It is really not practical to publish entire .exe launcher as fix, but I heard that it isn't case with DLL files. I could simply create DLL with my functions and if I fix some, I publish only DLL ( it's more elegant too ). My question is: what kind of knowledge in C++ should I have, so I can be able to create simple DLL...simple as it contains only one function ( for start )? …

Member Avatar
Member Avatar
+0 forum 2

Hi, I found the examples of explicit specialization, but I have a vagueness about code: using namespace std; template<class T = float, int i = 5> class A { public: A(); int value; }; template<> class A<> { public: A(); }; template<> class A<double, 10> { public: A(); }; template<class T, int i> A<T, i>::A() : value(i) { cout << "Primary template, " << "non-type argument is " << value << endl; } A<>::A() { cout << "Explicit specialization " << "default arguments" << endl; } A<double, 10>::A() { cout << "Explicit specialization " << "<double, 10>" << endl; } …

Member Avatar
Member Avatar
+0 forum 2

Hi, I have made some sorting function based on finding largest element and swapping its place with last element of array and then searching largest element of rest of array and putting it on one place before last one and so on. I am curious about is there a name for sorting of this type? I searched [URL="http://en.wikipedia.org/wiki/Sorting_algorithm"]Wikipedia[/URL], and the most similar sorting method seems to be a Heap sort. Here is the sorting function I made: [CODE]int Biggest(int Niz[], int n){ int x= Niz[0]; for(int i=1;i<n;++i) if(Niz[i]>x) x=Niz[i]; return x; } void Sort(int *Niz, int n){ int *temp=new int; …

Member Avatar
Member Avatar
+0 forum 2

Hi, When writing a little code for showing ASCII characters in C++ and C, the only difference is when I do it in C++ I print until char ( or integer ) reaches value of 127, and in C I print until it reaches 255. Why it's like that? Thanks!

Member Avatar
Member Avatar
+0 forum 6

Hi, I am learning templates so I have one question for this code: [CODE]template<typename T, int Number> class Data{ T Array[Number]; public: T& operator[](int); }; template <typename T,int Number> T& Data<T,Number>::operator[](int element){ return Array[element]; }[/CODE] I wish to create specialization for that class template, for any random data type, but my knowledge allows me only to create class template specialization for template with only one parameter . So I don't understand how'd the code look for class template specialization which contains expression parameter ( int Number ). Thanks.

Member Avatar
Member Avatar
+0 forum 2

Hi, I noticed many programmers accuse C++ as very hard language for GUI and very good language for the code. Is there any way to integrate 2 languages, C++ and any other language which is easy to make GUI with? Thanks.

Member Avatar
Member Avatar
+0 forum 5

Hi, I need help about launching a web site in default browser using Borland ( button click = launch google.com, for example ). I found solution valid in DEV: [CODE]ShellExecute(NULL, "open", "http://google.net", NULL, NULL, SW_SHOWNORMAL);[/CODE] But it shows an error if used in Borland: [ICODE]Access violation at address 0A1826C8 in module 'bordbk61.dll'. Write of address DD57D84A [/ICODE] And program freezes afterwards. Any solutions, or I'll need to use external bat launchers to open it >> system("open_site.bat")? :angry: Thanks!

Member Avatar
Member Avatar
+0 forum 3

Hi, I have an app created in Borland Builder 6, on Win 7, but I tested it on Win XP, and font's size changed, some forms resized... This guy has explained the problem >> [url]http://www.tek-tips.com/viewthread.cfm?qid=1668509[/url] Anyone experienced with this?

Member Avatar
+0 forum 0

Hi, Has anyone any clue why message boxes keep showing 2-3 times after clicking one of their button in Borland? Please answer, I need help. Thanks!

Member Avatar
Member Avatar
+0 forum 2

Hi, I need to create 39 images in Borland and set what will they do if you click on them. It'd be really long time to create all these using classic method ( adding images, and setting OnClick option ). But I figured out how to insert so many bitmaps: [CODE]TBitmap BmpMercedes[39]; int i=1,width=20; char Name[6]; try{ for(i;i<3;++i){ Name[0]=i+48; Name[1]='.'; Name[2]='b'; Name[3]='m'; Name[4]='p'; Name[5]='\0'; ShowMessage(Name); BmpMercedes[i].LoadFromFile(Name); Canvas->Draw(width,20,BmpMercedes); width+=50; } } catch(int e){}; }[/CODE] But I have no clue how to make it "sensitive" on click? Any possible way? Thanks a lot.

Member Avatar
+0 forum 0

Hi, I am creating the game which has a lot of images which present buttons and their different "surfaces" which depend of cursor ( move over it, click, mouse up... ). It's really boring to add so many options, to make the button look like Vista-style, so is there any way to just simply change location from where image is loaded, for example: [ICODE]D:\Somefolder\Image.jpg[/ICODE], and then change location to [ICODE]D:\Somefolder\Image1.jpg[/ICODE]. It'd be far easier since I wouldn't write codes for every image. Thanks.

Member Avatar
+0 forum 0

Hi, Is there any way to add specific location for images in Borland C++ Builder? For example, I have background image, but I want it to be in root folder, together with exe file (reason: I want to make it accessible for users, who has no access to the source code ) so if someone changes the image in folder, it gets changed in program too ( like modding 3D games ). Besides I can't set a specific location in HDD, I noticed BCB doesn't even need concrete image in HDD, as if it was saving it somewhere also and …

Member Avatar
+0 forum 0

Hi, I made code of several classes for game, not 3D nor 2D, it's like those on FaceBook where buttons are main. I'm curious, could code for that type of game be called Game Engine? Hmm... Thanks! :)

Member Avatar
Member Avatar
+0 forum 3

I wonder why it ain't possible to manipulate with static member of base class from derived class. [CODE]#include <cstdlib> #include <iostream> using namespace std; class Base{ public: static double BaseValue; void Set(double a){BaseValue=a;} void GetBaseValue(){cout<<BaseValue<<endl;}}; class Derived:public Base{ public: double Count(){ return BaseValue*2; } }; int main(int argc, char *argv[]) { Base Object; Object.Set(123.3); Object.GetBaseValue(); Derived Object1; cout<<Object1.Count()<<endl; system("PAUSE"); return EXIT_SUCCESS; } [/CODE] If all elements from base class are derived ( except default constructor and destructor, assignment operator and friends ), static member BaseValue should be derived too. But I get an error [ICODE] [Linker error] undefined reference to …

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm playing around with pointers and I found out something. For example, I have the array of objects of structure, and wished to point to it over the pointer which already points to it ( pointer to pointer to array of objects. ). Confusing? Code: [CODE]struct person{int number;}; int main() { person object[3]; for(int j=0;j<4;j++){ //Just filling variable number object[j].number=j+1; cout<<(object[j].number=j+1)<<endl; } person *pobject; //Declaring pointer to object pobject=object; for(int i=0;i<4;i++){ //Checking how does it point (good/bad) cout<<(pobject[i].number)<<endl; } person **pobject1[3]; //Declaring new pointer pobject1[0]=&pobject; for(int j=0;j<=5;j++){ //Printing variable number for(int i=0;i<=5;i++){ cout<<(pobject1[i][j]->number)<<endl; } } system("PAUSE"); return EXIT_SUCCESS; } …

Member Avatar
Member Avatar
+0 forum 4

Hi, Is there any possible way to create program which'd take some data from net and store it in program memory ( some variable, irrelevant ), for example - currency list? If there's no way in console, what about using Borland Builder 6? I hope my idea ain't so absurd :icon_wink: Thanks!

Member Avatar
Member Avatar
+0 forum 1

The End.