3,183 Posted Topics
Re: Is this a separate application or just another form in your program? If it's the latter then you can do what you want with an [MDI setup](http://www.codeproject.com/Articles/3553/Introduction-to-MDI-Forms-with-C). If it's the former then I'm not going to say you *can't* do it, but the concept is like saying "I want to … | |
I've needed to write sample code using conio.h over the years, but my compilers don't support all of it (most notable being clrscr() and gotoxy()). So I wrote a conio simulator class to help me. Not all of the conio.h functions are present, such as cgets() and cscanf(), because I … | |
Re: > What are the advantages of overloading the stream extraction operator to read data from a file? Among other things: * It saves the user of the class a lot of trouble in customizing I/O. * It saves you from having to design individual access to data members. * It's … | |
Re: > is it going to be possible to have a connection if I create a J2ME (netbeans) as client and vb.net (2010) as the server? Provided they both use a compatible connection method, yes. In some cases you might also need to massage the data to and from what the … | |
Re: > Does it really makes the process of programming faster? That's debatable. Especially with CodeIgniter, I'm not sure it makes things faster aside from offering a bunch of libraries that save you the trouble of reinventing the wheel. But I'm not convinced that the boilerplate of a framework is any … | |
Re: > so that the code will be something like this i think? Close. You forgot to close the two strings: Dim da As New OleDbDataAdapter("Select * from [" & Sheet1_EBU & "]", con) | |
Re: Are you physically drawing text onto the image or just overlaying text on the image at display time? The former will require some type of image processing library while the latter can be done with straight HTML/CSS assuming you have both the image and text available. | |
Re: "System" is pretty vague. Have your studies focused on anything in particular? Do you have any interests that might suggest a possible project? | |
Re: The answer is a definite maybe. As far as being effective, if it's not effective then it's not a viable solution because it doesn't work. So there's not really any degree here, it either works for your needs or it doesn't. Whether it's the most efficient way really depends on … ![]() | |
Re: [This](http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#radix) page goes into a little more detail for the same basic algorithm. It might help. | |
Re: The only difference between `struct` and `class` in C++ is default visibility. Structures are public by default and classes are private. Other than that they're identical in features and functionality. Use whichever makes more sense to you. | |
Re: "It's not working" is completely useless. Describe how it's not working if you want better help. But I'll point out some obvious flaws in the code: > `for (int i = 5 < = 100; 1 + = 5){` This line is all borked up. A for loop has three … | |
Re: > I believe the entire code is correct, but only the way I call the push and pop function mighe be wrong. Actually, a lot of the code is incorrect, but subtly so. The way you're using `void*` isn't quite right (note that `void**` doesn't do what you probably think … | |
Re: > After calling getchar() you need to clear the keyboard buffer of all remaining keys. Unfortunately there is no standard way of doing that. Well, there's a standard method, but it's situational in that there must be at least one character pending in the stream if you don't want to … | |
Re: > But not getting how to write. As Momerath mentioned, you need to consider whether the class *needs* to implement IDisposable in the first place. If it doesn't, there's no need to complicate the code by doing so. As for how to have a reusable disposal pattern without manually implementing … | |
Re: > In the following program You forgot to include the following program. > What do the mean by that? It means what it says. C++ doesn't stop you from walking off the end of an array: int a[4]; // Don't do this for (int i = 0; i < 100; … | |
Re: > How can I grow the size of a char array? That's easy, you can't. Arrays are statically sized and never change. If you want a dynamic array, you'll need to either *simulate* an array using pointers and dynamic allocation, or switch to a class that does it for you … | |
Re: You didn't provide enough code. Can you post a brief but *complete* program that exhibits the problem? | |
Re: Let's start with your assumption about the formatting of a numeric value, which isn't safe these days. Consider the following function that's designed to be locale-friendly for the same task: #include <ctype.h> #include <locale.h> #include <math.h> #include <string.h> char *dtoa(char buf[], double value, int precision, int show_sign) { char *grouping … | |
Re: Sorry, but if you want to use qsort() then the comparision functions must either be static members or non-members. A pointer to a member function means something quite different than a pointer to a static member function or non-member function, and because of this they're incompatible. The good news is … | |
Re: > can anyone mention what I can do to make this program more efficient? This is a case where I'd say you have no reason to worry about efficiency. > My problem is that I want to print only that string which is meaningful and not the garbage values. How … | |
Re: Those folder icons tell you the read status of the forum. When you click on the folder, it makes the forum as read, it's not supposed to navigate you to that forum. If you want to *go* to the forum, click on the name of it instead of the folder … | |
Re: > but i believe in case of without copy constructor it must have printed same memory address due shallow copy That's not the case because you aren't printing the address contained by the pointer, you're printing the address of the object that owns the pointer. Change your show() method to … | |
Re: > actually turbo c/c++ is no more upadated, as borland closed the project. so it don't support the ANSI C features, System() function is the part of ansi c. Turbo C/C++ is an ancient compiler for an outdated operating system, but it still supports C89 well enough that the system() … | |
Re: Clear your parameters collection when the values change, you're doubling them up and the variable name is a unique key: while (readerReference.Read()) { cmd_Insert.Parameters.Clear(); cmd_Insert.Parameters.AddWithValue("@emp_login", readerReference.GetInt32(loginIndex)); cmd_Insert.Parameters.AddWithValue("@emp_dom_code", readerReference.GetInt32(DomCodeLoginIndex)); cmd_Insert.Parameters.AddWithValue("@emp_domain", readerReference.GetString(dom_domain)); cmd_Insert.Parameters.AddWithValue("@emp_surname", readerReference.GetString(emp_surname)); cmd_Insert.ExecuteNonQuery(); } | |
Re: Test it out and see: #include <iostream> using namespace std; int main() { cout << "'"; cout << "foo"; cout << "'\n"; cout << "'"; cout.width(10); cout << "bar"; cout << "'\n"; cout << "'"; cout.width(10); cout.setf(ios::left); cout << "baz"; cout << "'\n"; } As for where to figure these … | |
Re: > So, I'm suppose to make a program following these guidelines. Good luck with that. | |
Re: The conversion between a string and double isn't implicit. Try calling [Convert.ToDouble()](http://msdn.microsoft.com/en-us/library/zh1hkw6k.aspx). | |
Re: I'd use an array where the index represents the horse and the value stored at that index is the number of wins: int wins[9] = {0}; // Simulate 100 races with each horse having equal probability of winning for (int i = 0; i < 100; i++) { ++wins[rand() % … | |
Re: > a = here*; This isn't valid syntax. > and in the function I check if here is NULL or not You're not checking if `here` is NULL, you're checking if `here->key` is NULL. `here->key` is a char, so the test is nonsensical given that one of the operands is … | |
Re: > I was wondering how the compiler searches for a file using just the name of the particular file. Typically, a relative path will behave as if the current working directory were prepended. For example, on Windows `"file.txt"` would be treated as if it were `"%cd%\file.txt"`. > If I have … | |
Re: Hmm, seems awkward. I'd probably start by trying something like this: private bool _addingItem = false; private void comboBox_SelectionChangeCommitted(object sender, EventArgs e) { var ctrl = sender as ComboBox; if (ctrl.SelectedItem.ToString() == "Add") { _addingItem = true; ctrl.Focus(); } } private void comboBox_KeyDown(object sender, KeyEventArgs e) { if (!_addingItem) { … | |
Re: The filtered words list can be a little funky. IIRC, the weirdness comes from Dani's analysis of words that are most likely to be used in an insulting manner towards another person. Given that we already require members to be at least 13 years of age, I'd prefer no automatic … | |
Re: > My question is what [100] in the first line of the Pseudocode stands for? It's the size of an [array](http://en.wikipedia.org/wiki/Array_data_type). | |
Re: If the type is unknown, try using Object^. Provided you're working with CLI types, they're all derived from Object. | |
Re: For starters, movie_rent is neither an object nor an array, it's a type. The object declaration would be more correct like this: struct { char name[20]; char year[20]; int inout[20]; } movie_rent[20]; But that doesn't fix your syntax issues because you can't seem to decide if movie_rent is an array … | |
Re: In lines 11 and 15 you're *assigning* to `$count`, not comparing it. | |
Re: Your findMin() has two problems, one is a bug and another is a usability problem. The bug is that you're moving the pointer ahead by `j` steps on *every* recursive call, but you're also using `j` as an index into the array. This is basically a guaranteed access out of … | |
Re: [GIMP](http://www.gimp.org/) is the open source equivalent to Photoshop, but don't expect it to be as user friendly. I'm not familiar with the latest HTML packages. try searching Google. I use NetBeans if you're interested, though it's more of an IDE for PHP than a website designer like Dreamweaver. | |
Re: > I was thinking of creating a class that stores all relevant data but I dont know if that would make it less efficient Here's a novel idea: try it and see what happens. Then you'll know after teaching yourself through experience. ;) | |
Re: > how difficult would it be to have a .lib and a .dll file so I can work with both Linux/Unix and Windows? You'd have two builds for the two systems. Whether the actual code that gets built needs to be ported to support the different systems depends on what … | |
Re: > Download a reference manual and use it is my advice. That's too much work when they can just post their problem to umpteen forums with the expectation that some kind soul will do it for them. > I'm not an IT professional, I'm a hobbyist, and I've learned all … | |
Re: > Anyone know how to do it that way? Unless you feel like dropping down to inline assembly, the best (only) solution is to verify that the operation won't overflow *before* you perform it. | |
Re: Your query failed for some reason. I notice you didn't provide a connection as the second argument to mysql_query(), have you opened a connection to the database already? | |
Re: > Please help? What am I doing wrong? You're not closing `binaryNum` as a string, so garbage gets copied into `immeStr`. Change the definition to this for a simple solution: char binaryNum[bit+1] = {0}; | |
Re: I would ask a few questions: 1. *"31 32 33..... til end of file"*. What does end of file mean here? Are you reading input from a file? Are you just printing numbers until the user tells you to stop? The behavior isn't obvious here, so writing code for it … | |
Re: > `*bushels[i] = *(bushels[i]*price);` The indexing operator already dereferences the pointer, what you're trying to do is dereference a float value, which clearly won't work. Try this instead: bushels[i] = bushels[i] * price; Or using the compound operator: bushels[i] *= price; |
The End.