3,183 Posted Topics
Re: See [this tutorial](http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_hashtable.aspx) for details on writing a hash table. As far as extracting each item in the list for adding to the dictionary, it should be a simple cursor-based traversal: Dict CreateDic(void) { void AddDic(Dict*, student*); LIST cursor; Dict dict; for (cursor = 0; cursor != -1; cursor = … | |
Re: > Can you please PM me since I can't PM anyone here. You can post though, so do that. It's actually preferred as more people will be able to help when the information is publicly available. | |
Re: > I'm set to invisible, or is that irrelevant? :) If you're invisible then you get no dot. ;) | |
Re: > hey guys so i was thinking of how i would make a program that would state the alphabet from a-z in capitols then the program would change it all to lower case one at a time. And what did think? | |
Re: > but the problem is in how do i convert all this data You don't. Pretty much the only C++isms the code uses are in I/O. Replace cin and cout with scanf() and printf() and you're *done* except for minor syntax errors that are trivial to fix. | |
Re: > Does anyone have any more experiences that they wouldn't mind sharing? Mine is a cynical view after having been a system administrator *and* working with them in many different companies as a consultant. I typically don't expect sys admins to be experts even in the systems they administer. My … | |
Re: > are the other languages any easier than c? Depends on which "other" languages you're thinking about, but in general, yes. C is a simple language, but it's not *easy* because it doesn't hold your hand. You need to think about and manage a lot of low level things to … | |
Re: > this means the function will exept a pointer and it is a IntPtr type.can you tell me how it is equivalent to a double pointer ??? `IntPtr` is defined as typedef int* IntPtr; The second asterisk is hidden by the typedef, so `IntPtr*` becomes `int**` when evaluated. Your confusion … | |
Re: The type of file is irrelevant if you're treating it as a sequence of bytes. As long as you don't lose any packets in the transfer, the .exe will be reconstructed correctly and will run on a matching OS. | |
Re: If you have to delete an entry, the simplest method conceptually is to rewrite the file in its entirety without the entry in question. For huge files that can be a performance issue, but for a school project you don't need to concern yourself with huge files. | |
Re: > I hope not be booted out for ignorance. No worries, the vast majority of Daniweb consists of people trying to learn more. Ignorance isn't looked down on. > "There's no such thing as a stupid questioin." That's not true in my experience, but we don't hold stupid questions against … | |
Re: Welcome aboard! That's my background as well. I started out as a system admin/IT technician to get my foot in the door and then moved to software development with a focus on .NET and C#. Yes, the learning curve is steep, but that's half the fun. ;) | |
Re: > I can answer just about any question on any subject given its a question with one factual answer :) What happens after we die? ;) | |
Re: > You will never use & in printf() unless you plan on printing out raw memory addresses, which you will almost never do. Never say never. ;) printf() supports a %n specifier that assigns the number of characters written up to that point: #include <stdio.h> int main(void) { int n … | |
Re: Good luck with that. I hope you realize that you failed to provide enough information for anyone to help you. | |
Re: > I haven't tried windows 8 yet,I can't find a site to download,thanks http://windows.microsoft.com/en-US/windows/buy | |
Re: Without looking at your code (because let's be fair, there's a lot of it), my gut reaction is that you've done something somewhere that corrupted the vector. This is most likely due to an out of range access or wayward pointer. So in troubleshooting I'd focus on memory corruption. Can … | |
Re: Namespace definitions can be split across multiple files and still have the same name, is that what you mean by "shared"? // file1.cpp namespace foo { class A {}; class B {}; } // file2.cpp namespace foo { class C {}; class D {}; } When the project is built, … | |
Re: > however it says that it is an implicit declaration of function "main" > and that it is invalid in C99 I'm guessing your main is defined like this: main() { ... } That definition uses a feature called "implicit int", wherein if a type is required such as in … | |
Re: Of course, you're always welcome to request that a post be deleted. But be aware that unless it's a flagrant violation of the rules, we're likely to reject the request. On the other hand, if it's a simple matter of removing something like personal information from a post, we're generally … | |
Re: I try to understand any person I'm communicating with, figure out their native language and country of origin, level of education, perhaps even religious and political beliefs. Only then can I offend them as efficiently as possible. :D | |
Re: > if(ch==69||ch==101) > else if(ch==81||ch==113) What do 69 and 101 mean? What do 81 and 113 mean? If you force me to memorize ASCII/Unicode or go to asciitable.com to figure out your code then your code is bad. Use the character literals that correspond to what you want, it makes … | |
Re: You can use free SMTP servers such as those with Gmail. | |
Re: This smells like homework where you were given everything except the implementation for perfectShuffle(). As such, I'm going to ask that you prove you've made an honest attempt at completing the assignment. Do you understand how a perfect shuffle works? That's the first step, because you can't tell a computer … | |
Re: Holes in your work history are more damning than history in unrelated fields. So yes, add that job. | |
Re: Seems simple enough: #include <iostream> class M_48 { static int instances; public: M_48() { std::cout << ++instances << ": Foo!\n"; } }; int M_48::instances = 0; // This is the part you really want int main() { M_48 foo[37]; } | |
Re: > In the book called gnu c manual I read that the following code has an undefined behavior `i = ++i + 1;` Because since the variable i is modified more than once between the sequence point,it is not sure that what value will 'i' have. That's correct. > But … | |
Re: ...seriously? I mean, come on, did you really think "Help?" would be productive in the slightest? Ask a real question. | |
Re: > it mimics the function system from Windows system() is a standard C/C++ function, it's available on Linux too. ;) You probably knew that, of course, but your choice of phrase could be confusing to less experienced folks. | |
Re: `sizefn_t` is a [typedef](http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=%2Fcom.ibm.vacpp6m.doc%2Flanguage%2Fref%2Fclrc03typdef.htm) for a [pointer to a function](http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/index.jsp?topic=%2Fcom.ibm.vacpp7a.doc%2Flanguage%2Fref%2Fclrc07cplr242.htm). The typedef simplifies the syntax for said pointers because otherwise the syntax is pretty awkward: // Declare a pointer to function and point it to useSizeFace() double (*sizefn)(double*) = userSizeFace; All the typedef does is wrap the awkwardness into a … | |
Re: Not to mention it wouldn't pass code review in any development house I've worked with (assuming it compiled). The code itself is brittle and the solution is clearly written by someone who hasn't done much date and time programming. | |
Re: I'd suggest reading each line with fgets() and then parsing it in memory to extract fields. You can do the parsing with sscanf(), though it can get a little tricky unless you guarantee that the file ends with a newline character, because you need to consider fields that end in … | |
Re: Just provide a public property in form two that the button click event sets in form one. The setter for the property would invalidate the textbox in form two and cause it to redraw. Easy peasy. And no, I won't give you the code for it because this is clearly … | |
Re: > for example by adding \" it interprates " as a string then why cannot we use \ in our case? Because escape characters are interpreted at the compiler level and format specifiers are interpreted at the library level. If `\%` gave you a literal `'%'` then it would still … | |
Re: > I have found the solution in other websites that we have to clear the buffer and use cin.ingnore(). Does anyone tell me what does it means ?? cin.ignore() reads and discards characters. `cin.ignore(80, '\n')` is roughly equivalent to this loop: { char ch; for (int i = 0; i … | |
Re: > Is there a way to change your avatar into an animated avatar? No. When you upload an avatar, we resize it internally to ensure that it's 80x80, and the method we use to do that only returns the first frame of an animated image. > I have seen a … | |
Re: > int *sum=0; `sum` is a pointer yet you use it as an integer. It shouldn't be a pointer in this case. | |
Re: > Any incorrect or improvement needed? It's completely broken. I'm fairly confident you didn't attempt to compile that code, much less run it. | |
Re: When you forward declare a class, you only tell the compiler that it exists, not what's in it. So while the declarations are fine, the definition of FileTwo::Test() would need to be deferred until after both classes have been introduced completely: class FileOne; class FileTwo { public: int Test(FileOne One); … | |
Re: GCC doesn't support void main, therefore any use of it invokes undefined behavior. More specifically, if the compiler doesn't support void main then the code it produces could be [very wrong or dangerous](http://users.aber.ac.uk/auj/voidmain.cgi). | |
Re: While I don't disagree that VBA is missing a solid home, I'm not convinced that we need to add a new forum when VBA threads can be tagged as such and placed in a forum that's "close enough" and likely to be seen by fellow VBA peeps. ![]() | |
Re: > The problem is that it's my first project of its kind and i don't know how to start also the defregmant part is a bit tricky So you haven't been given any projects in the entire course? This is the *final* project, which means you can't play the clueless … | |
Re: An example is mentioned specifically in the form of prepending size information to the block of memory. If the object is small, the overhead of size information can be prohibitive. It's only when the allocated objects get bigger that the "bookkeeping" information gets amortized away. | |
Re: You can use negative values in the Add\*() methods to represent subtraction from the current value: datetime.AddSeconds(-1) ' Decrement by one second | |
Re: > A function prototype is also called a function declaration. You supplied a function definition. A definition is also a declaration, but a declaration is not always a prototype. A prototype is the very specific declaration without a body that defines parameters (excluding the case of an empty parameter list), … | |
Re: A hardware barcode reader will give you the contents of the barcode, so there's nothing barcode specific you need to do in your program. Just accept standard input as if it came from a keyboard. |
The End.