6,741 Posted Topics
Re: Employers typically assume practical experience, such as the time you've worked professionally or on significant projects (ie. open source). If you add a year for the time you spent in your room writing variations of "hello world", that would be padding your resume. | |
Re: >there is something called internal ,typecasting which will type cast the return type for you The conventional terminology is "implicit conversion" while casting is another conventional term for explicit conversion. | |
Re: >why is referred two times the 'sizeof Msg1' (sizeof Msg1 / sizeof *Msg1) separated by '/' ? The size of the array in bytes (sizeof Msg1) divided by the size of a single element in bytes (sizeof *Msg1) gives you the number of elements in the array. It's a way … | |
Re: >Dev C++ let me skip those for some reason. Now you know why it's a good idea to test your code with multiple compilers. | |
Re: Hmm, tough cookies. By the time you've instantiated objects, each object has a separate copy of the variables, so you have to update each object separately. That said, it's possible to update all of the variables at once, but only if they're inherited as static members to class A: [code=cplusplus] … | |
Re: >Switch case is faster if there are more than 2 conditions to be checked First, you shouldn't use absolute statements like "X is faster than Y", because you'll nearly always be wrong. Second, where did you come up with two conditions? That seems like a very compiler-specific statement to me. … | |
Re: >getline() function is in the library of #incude <conio.h> Um, no. The getline function (the one that accepts a std::string) is declared in the <string> header. >but it doesn't come up with the desire output. Here's a pattern that you'd be wise to learn so you can spot it again: … | |
Re: >C2679: binary '>>' : no operator defined which takes >a right-hand operand of type 'class std::basic_string You forgot to include the <string> header. | |
Re: Don't use an array. A std::set or std::map seems much better suited to your problem. | |
Re: >Is there a difference, in terms of performance, between the two loops below? It depends on your compiler. There are tons of factors that come into play, such as how your compiler manages stack space, whether the underlying type of const_iterator is a simple pointer or an object, how temporary … | |
Re: >I understand all the given examples Really? I still don't understand how some of those examples are expected to work, they're so buggy and poorly written. :icon_rolleyes: >but the exercises seem impossible You're pretty much expected to be a graduate student taking higher mathematics courses to do those exercises. Don't … | |
Re: >this code isnt workin This is a waste of keystrokes. Do you go to the doctor, say "I don't feel good", and expect an accurate diagnosis? Do you go to the mechanic, say "My car is broken", and expect the actual problem to get fixed? If you answered no to … | |
Re: > and it doesnt mention code-tags Code tags are a feature of Daniweb's forum. You take your code and wrap it in code tags like so when you want to post it here: (code=cplusplus) *<code from your book here>* (/code) This preserves the formatting of your code rather than trimming … | |
Re: >If I type some integer in it, it is ok. The error is correct, but not as informative as it could be. Just because you declare a variable to be const doesn't mean that it's guaranteed to be a compile-time constant. In this case, [ICODE]aFormatCtx->bit_rate[/ICODE] probably can't be resolved at … | |
Re: >I'm just wondering how to start doing this problem? Start by understanding the process of converting infix to postfix. Once you have that, it's not much of a stretch to see how a stack could be used to do it. Or you could do a google search and get one … | |
Re: Use a loop to read more than one line: [code=cplusplus] ifstream in ( "myfile" ); if ( in ) { string line; while ( getline ( in, line ) ) cout<< line <<'\n'; } [/code] | |
Re: Right...would you be kind enough to point out which line throws the error? | |
Re: >but you actually named your post "Do my homework for me."? I named the thread when I split the post from an existing thread. >Also, doubly linked lists are NOT reffered to as DLLs. Actually, they are. Especially in books you'll see mention of DLL and SLL to refer to … | |
Re: >word occurences on c/c++ language database Can you be more specific about what this "database" is? Is it just a text file, a relational database, or something else? | |
Re: >Are basic types automatically initialized to 0 in C++ when allocated via new ? No, automatic default initialization of built-in objects doesn't happen most of the time. You'll see it with objects that have static storage duration, typically. But you can force default initialization with an explicit empty parameter list: … | |
Re: >I'm unable to make these programs and have to submit on thursday!! Whining about it doesn't accomplish anything. The questions aren't difficult if you were paying attention in class, so you've only yourself to blame. Take the failing grade and learn your lesson, is my advice. >Q. Make a header … | |
Re: I do recall reading one of your threads that asked basically the same question and received a good answer (an answer which would solve your current similar problem). Perhaps you should take the time to learn the concepts of the answers you're given rather than just slapping the example code … | |
Re: >no matter what I try the output remains integer If you perform an operation on two integers that wouldn't have any precision even if converted to a double, why would you expect anything but a zero precision? No amount of casting will create something that isn't there. ![]() | |
Re: >char in C/C++ actually is a 8-bits integer ranging from 0 to 255. While that may be true on your PC, C and C++ don't require char to be an 8-bit type. Further, vanilla char is allowed to be either signed or unsigned (the choice is made by your compiler), … | |
Re: >Any help is good =] I'm curious, can you define what you mean by "help"? Because it looks a lot like you want us to do your homework for you. Anyway, [url=http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx]this[/url] may help you. | |
Re: >I have been trying to learn C++ for a few months know but I'm still not 100%. I've been trying to learn C++ for well over a decade. My job requires intimate knowledge of the language, but I'm still not 100%. Don't get frustrated if you find yourself confused, because … | |
Re: Well, you also need to add the objects to the vector using something like [ICODE]characters.push_back ( my_character );[/ICODE]. | |
Re: >my question is why can't we initialize np->name=name directly ? Well, you [i]can[/i] if you want to, but it likely won't do what you want. Copying pointers around just means you have a bunch of aliases to the same block of memory. When people do an assignment like [ICODE]np->name = … | |
Re: >i would this in DOS using TSR program to fire events with.... I would too...15 years ago, and only on DOS because TSRs were a hack to get around the weaknesses of an OS that couldn't handle more than one running program at a time. Now I'd use the event … | |
Re: >I just can't get them all in one line using setw() Show us your code that uses setw, an example of the output you're expecting, and an example of the output you actually get. | |
Re: Well, you can get it to count up, so now you need to get it to count up and then back down again on the same line. How about stopping at half of what you were stopping at, then printing j until it reaches 0? [code=cplusplus] for ( i = … | |
Re: Just remember two basic rules and you'll be fine: 1) Being my friend doesn't make you a friend of my children. 2) Being my friend doesn't make you a friend of my other friends. >What effect does making the friend class protected have Zero. It doesn't matter if the friend … | |
Re: >Which of those are ok and which are not (if any)? They're all valid XML. The extra space in an empty element is a style guideline in XHTML for compatibility reasons, but that has to do with conforming applications and not the requirements of a parser. >can there be whitespace … | |
Re: Good advice in general. The particularly noticeable poor advice is smoothed out by clearly being specific to Google and practicality with their existing code base. While I can see their reasoning, I very much dislike their stance on exceptions. Hopefully non-Google people reading this guide will ignore that convention. | |
Re: Could you describe the bug? I think I know what you're talking about, but simply giving an image with no explanation isn't terribly helpful. | |
Re: >Does anyone want to help? No. >A disassembler would be good, too. [url]www.google.com[/url] would be a good place to start searching. | |
Re: [code=cplusplus] if (cin.good()) { break; cin.sync(); } [/code] The sync call will never be reached in this snippet because break leaves the loop immediately. >why ?? Because when you type a value that cin doesn't expect (ie. a non-integer character when an integer is expected), cin goes into an error … | |
Re: Using read and write to serialize your objects is generally a bad idea. At the risk of being too vague, I'll distill all of my experience into one piece of advice for your convenience: When you want to serialize an object manually, convert each of the fields to a string, … | |
Re: Don't forget the argument list when you call the function through a function pointer: [code=cplusplus] #include <stdio.h> int foo ( void ) { return 12345; } int main ( void ) { int (*p)( void ) = &foo; printf ( "%d\n", (*p)() ); return 0; } [/code] | |
Re: >i want to hide those lines and it will be replaced with another statement. Technically those lines don't belong to you and you shouldn't be messing with them. This is akin to the "how do I clear the screen" question, where the answer is "you don't, it's anti-social". But if … | |
Re: >Why doesn't this work? It works as intended, what did you expect it to do? | |
Re: I think it's time for you to discover the wonders of the tab key. Seriously, zero-width indentation is hard to read for everyone. | |
Re: [url=http://www.charlespetzold.com/pw5/]This[/url] should be your first Windows programming book. | |
Re: I'd recommend that you use the std::set class. It has O(log N) time complexity for search-based operations and the duplicate rules mean that you don't need any special logic for finding unique grams. | |
Re: >temp1=temp; >temp1->next=start2; You say start2 is a null pointer, right? Well when you assign temp to temp1, you're aliasing temp, not copying the data at that address. So when you set temp1->next to null, temp->next is also set to null implicitly. You probably want something more like this: [code=cplusplus] temp1->data=temp->data; … | |
Re: Infix notation is relatively difficult to parse. If you're doing this to learn how interpreters work, I'd recommend starting with a simpler syntax. For example, instead of "Number1 == 2", you could more easily parse "Number1 2 ==" (ie. postfix notation) with a simple stack. |
The End.