948 Posted Topics
Re: There sure is! Lookup the function [icode]atoi()[/icode] | |
Re: I'm not 100% sure, but I don't think this can be done. There's no logical mechanic that allows this as far as I'm aware. EDIT: I stand corrected, it can be done, I just don't know how. I'm going to look into this, it looks interesting :) | |
Re: Firstly, in future please use code tags. Secondly, the "VALUES" section of your SQL Statement needs to be enclosed by parenthesis also. You haven't used any. [icode]INSERT INTO MyTable(Id, Name) VALUES(12, 'BoB')[/icode] | |
Re: Yeah a socket can be used. You simply create a TCP Connection to port 80 and issue a request for the page. [URL="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol"]This Site[/URL] tells you what the form of the message is. Scan the response header and see if it has 404 set. If not, you can discard the … | |
Re: You're trying to access a private variable from outside the class. [icode]void date::wordform(date d1)[/icode] Although you're inside the date class, you're not inside [b]the instance[/b] of d1. [icode]d1.month[/icode] will fail. You are trying to access the private variable of d1. [icode]d1.getmonth[/icode] will succeed as you are accessing the public method, … | |
Re: Looks pretty straightforward. What's the problem exactly? | |
Re: [URL="http://en.wikipedia.org/wiki/Huffman_coding"]Wikipedia[/URL] seems to be very knowledgeable in this area. Use [URL="http://translate.google.com"]Google Translate[/URL] which should assist translating it into your native language. | |
Re: I would begin by designing something that could become quite large. I don't mean full scale design though. For example. I would treat everything as a GameObject where GameObject has some basic data like "Description", "Position" etc and some basic functionality like "PrintDescription", "Push", "Pull" etc. Then specify more; so … | |
Re: You could make it OO I guess? Something that simple doesn't really need it though but if you want to do it as an exercise, try creating classes for the types of rabbits. | |
Re: Op, another point. Your code will loop forever if everything is correct. | |
Re: Just out of interest, why are you using Managed C++ and not C#? | |
Re: I strongly disagree with the second method also. Projects should define library boundaries not class boundaries. If you had a class that erased your HDD, a class that opened up a webpage and a class that calculated how old you were. Then I think it's perfectly acceptable that they go … | |
Re: If speed and quality of the drawing is an issue, you might be better moving over to Managed DirectX. Other than that, nick's post is the best logical way I can think of atm. | |
Re: Please clarify what you mean by DRAC. I've googled for it, but the only seemingly relevant term is the Dell Remote Access Card... | |
Re: Can you please tell us what kind of exception you're getting? I don't believe xlocale is your own code. It will probably be called during some kind of string manipulation or formatting. Can you post your code? If it's more than 50 lines, please attach as files. | |
Re: If you use Windows and you actually want to LOCK the drive, then look up the function DeviceIoControl. That should give you a place to start | |
Re: Have you checked the connection string? | |
Re: You're hooking into the Windows API (P/Invoke). Have you got any left over handles using up memory? The debugger should say where your error is occurring. Also, try running this as a standard winforms app and see what happens. GC.Collect() won't always clean up the memory and unless you're running … | |
Re: [code] struct MYSTRUCT { int a; double b; float c; };[/code] | |
Re: This is a misleading error. Your compiler is set to unicode, hence it needs to use [i]wide[/i] characters. std::string has a method called c_str() to convert a string to a char*. But you will need to convert it from a multi-byte-string to a wide-character-string. (other keywords are wchar, wstring and … | |
| |
Re: Gah, my bad. Resurrected thread based on sandhya's post. | |
Re: What have you tried so far? [URL="http://www.google.com"]This Website[/URL] should tell you all you need to know. | |
Re: If you check your other thread I've already told you what the problem is. For the sake of argument, I'll repeat myself. Calling getline is overwriting your text variable with each loop. Therefore, when you press enter twice, text contains the character '32' (Which represents Enter) When you get your … | |
Re: Argh! My Eyes! o.O Onto the problem... You've declared a pointer but not told the compiler to assign anything to it. [URL="http://www.cprogramming.com/tutorial/lesson6.html"]Here's a decent tutorial on pointers[/URL] | |
Re: Hi there! Am I correct in assuming you want to access the parallel port? You may be better using CreateFile("LPT1",GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL); Then using ReadFile and WriteFile to read and write data over the port using the handle that "CreateFile" generates. The reason you cannot access it directly is because it exists … | |
Re: [QUOTE=jonsca;1223227]I understand what you are getting at. I agree that sometimes people dump off yards and yards of code when it's not always necessary. However, I think asking for the smallest and yet compilable code can bring about a Heisenberg-like effect. The more the OP takes out the trickier it … | |
Re: Can you give a little more information about the segmentation fault you're getting. When does it happen? What's happening on screen? What data is given to you with the fault? | |
Re: Ok, when you declare a class or a struct and you don't use any access modifiers, unless you specify otherwise, they default to PRIVATE. So your variable declarations above are actually public, not private. Whereas if you don't use the "public" access modifier on your methods they will be private. … | |
Re: This is a scripting language for what appears to be Modern Warfare 2. Create the while loop as chiwawa10 has done but catch the disconnect event inside it and break when you see it. | |
Re: You say you think there is a memory leak. What is giving you that impression? There is a mistake in the code, it won't stop it working and it's so glaringly obvious I'm reluctant to point it out =/ | |
Re: [QUOTE=nick.crane;1222174]tinyint is already unsigned. It is a just a single byte of value 0-255.[/QUOTE] A point to remember if you ever need to translate to MySQL is that MySQL stores tinyint as SIGNED by default, whereas MS SQL stores it as UNSIGNED by default. You can cast between the two … | |
Re: From the compiler errors you've tried to instantiate an abstract class. Abstract classes cannot be instantiated and must be inherited. This is an abstract class: [code]class MyAbstract { public: virtual void PrintLetter(char letter) = 0; } [/code] To use an abstract class you must inherit it and override the virtual … | |
Re: From an algorithmic point of view, the A* Algorithm is probably the most commonly used path-finding algorithm. Google fishing will come up with results aplenty. | |
Re: Have you stepped through your code to make sure your TransferInfo method is being called for each person? | |
Re: The only thing close is to use Triggers. Triggers are fired on an event you specify. The only problem is they can't connect back to your code. The only possible combination is to use triggers with a messaging server using plugins that can be found in the UDF Sources. This … | |
Re: You have to do the second one. EDIT: For memory leak diagnostics I recommend using Visual Leak Detector (if you're using Visual Studio) EDIT 2: The reason you must delete, is that if we take your code as an example, you create an instance of the point "AnotherClass" and assign … | |
Re: Hi there, this is a notification to the guys who that that ++i would start at "1" whereas i++ would start at 0. This is an incorrect assertion. The difference between ++i and i++ you are correct to a degree. ++i does addition before assignment and i++ does assignment before … | |
Re: Please see the post above your last. That is the correct method. Remember you can use variables as your key name, they don't have to be quote marked. [code] string str = "bob"; hashtable["bob"]; hashtable[str]; [/code] Choosing either of the above will give you the same result. | |
Re: Personally, if you wanted to do that, I would pass a pointer to the array and the array's length. [CODE]void someFunc(double* myArray, long arrayLength) { // Do stuff with array using arrayLength to ensure no out of bounds exception // Also note any changes made in here will be reflected … | |
Re: A much cleaner way would be to initialise your images and associate the Tag property with their name: [code]Image imgOne = Resource.YourImage; imgOne.Tag = ImageNameString; [/code] Then initialise your Image List: [code]List<Image> imageList = new List<Image>{// Your Images};[/code] Then initialise your PictureBox list: [code]List<PictureBox> pictureBoxList = new List<PictureBox>();[/code] Ok now … | |
Re: There are basically two methods of interaction for MFC. AFXSocket (which is the MFC implementation of winsock2) or socket (C-Style library for winsock2) First you need to set up your method of communication, then choose which type of transmission protocol (TCP/UDP) and finally decide on your application protocol (how it … | |
Re: Hi there, it looks like you want to be using DirectX (or the Tao OpenGL Libraries). A tutorial for DirectX in C# can be found [URL="http://www.codersource.net/AspNet/DirectX/DirectXProgramminginC.aspx"]here[/URL] | |
Re: So if I understand you. You have a list of nodes, and in each node you have 20-ish variables of data (in an array?) When you perform the List::Compare function you want it to compare a set of numbers you choose, with every variable of data in every node of … | |
Re: [CODE]DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); DataTable userTables = null; using (DbConnection connection = factory.CreateConnection()) { connection.ConnectionString = "Provider=Microsoft .Jet.OLEDB.4.0;Data Source=" & file; // We only want user tables, not system tables string[] restrictions = new string[4]; restrictions[3] = "Table"; connection.Open(); // Get list of user tables userTables = connection.GetSchema("Tables", restrictions); } … |
The End.