6,741 Posted Topics
Re: >And really what i am asking is why won't this compile? Probably because you haven't yet learned to program incrementally. Scrap your code and start over, this time write just a little bit before making sure it'll compile and works as expected. Write a little more, then compile again and … | |
Re: It seems you lack the basics of netiquette, so allow me educate you. Bumping a thread (ie. replying with pointless posts in an attempt to move your thread to the top of the list) is extremely rude and selfish. It suggests that you believe yourself to be more important than … | |
Re: >I think the new message should be added to the end of my last >post instead of creating a new separated box with avatar/stats. If I understand your request, then I'd argue that it makes no sense. For example, let's say you make a post, then there's a short discussion … | |
Re: It's your money, so you can spend it wherever you want. I wouldn't waste the money though; I have yet to hear about one of these online courses that wasn't a total rip off. You can learn more with free online resources than any course could provide. | |
Re: >Expression: stream != NULL Yet more proof (as if we needed any) that checking for success is a good thing. perror is your friend, my friend: [code=cplusplus] fp = fopen ( filename, "r" ); if ( fp == NULL ) { perror ( "Error opening file" ); exit ( EXIT_FAILURE … | |
Re: >I have grown to hate the "while not at end of file" stuff Me too. Mostly because in C and C++ it's a subtle and dangerous error. | |
Re: >1. The "system("pause")" doesn't work. >2. I get an error message when I compile. Well obviously your system call doesn't work if the code won't compile. What's the error message? | |
Re: >void main(){ main returns int. In C++ main returns 0 automagically, so you don't even have the excuse of saving keystrokes anymore. >input2 = "\"" + input + "\""; This is unnecessary. In fact, that's likely a big part of your problem. >while(!infile.eof()){ The timing of eof() is such that … | |
Re: >Thats why I have no idea why its there? It's there because a right shift may or may not fill the vacated bits with zeros. If the type of source[i] is signed, the implementation could fill the bits with zeros (a logical shift) or the value of the sign bit … | |
Re: >What makes a good prgoammers? A lot of things, and I'd even go so far as to say you can't enumerate the qualities of a good programmer. But you'll know when you meet one. >What made you get a job? I find programming far more interesting than the alternatives. >Why … | |
Re: >wat does these statements .do............... What does your reference manual say? | |
| |
Re: >I'm going to handle this for once and for all today. I'd love to see the transcript for that call. Seeing you lay down the law would be entertaining, I imagine. :) | |
Re: >Now-a-days I'm deeply interested in topics like hcking and virus. That's nice. Don't get arrested. >Can u suggest a link where I can create my own virus. If you aren't smart enough to figure it out without help, you aren't wise enough to use the result responsibly. Don't expect any … | |
Re: >I am on Windows xp professional edition and looking for a free >develeopment tool/ide for some self c++ learning. Most of the good compilers come with an IDE and are freely available. >but it is still beta version and I want something stable. I haven't noticed any instability in the … | |
Re: Do you know how to do it by hand? It's the same principle. | |
Re: Do you know how to convert a hexadecimal value to decimal on paper? That's the first step, then you can convert the paper algorithm into something better suited for assembly. | |
Re: >when the list is in disorder for example (1,3,5,4) still >says is in ascendent order. How could i fix that? You wait until after the loop to print the result, obviously: [code=cplusplus] node *curr = head; bool ascending = true; bool descending = true; while ( curr->next != 0 ) … | |
Re: >*What do I do to fix this?* Figure out where you're trying to dereference a null pointer in your code. | |
Re: It's better to do your report on something you enjoy, but personally, I find RMS to be a better topic in that there's more potential interesting content. >Thats why its officially called GNU/Linux. Officially by whom? Linux has never agreed that GNU/Linux is a valid name, nor has LI. There's … | |
Re: "Keyword" is a term already used to mean something else, so redefining it will only confuse you. What you're doing is creating an variable of the ofstream class and calling it "example". You then invoke functions on that variable. Calling member functions can be confusing if you try to think … | |
Re: >seem it is trick question. It [I]is[/I] a trick question. Not only can the size of a pointer vary depending on the system, the size of pointers to different types aren't required to be the same. The best answer to this question would be [ICODE]sizeof p[/ICODE], where p is defined … | |
Re: >This is C++. That really changes nothing, rand and srand usage remains the same across the two languages. [url=http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx]Here's[/url] another one that I'd recommend for obvious reasons. | |
Re: There aren't any. The only thing you'll get from a C certification is a lighter wallet. | |
Re: Duplicate posts deleted. It was probably a glitch in vBulletin, so just relax, Fox Hound. I think you might be a little too high strung to work in the gaming industry. :icon_rolleyes: | |
Re: >Does it need a copy constructor and an operator= for a class which have array member? No, the default behavior will do what you want. | |
Re: The nice thing about pseudocode is that you make up the rules. Most real languages do allow what you want, though, so you're not really deviating from common use. | |
Re: >Then it's printing it's value as 4, But logically it should be 2 because >the integer range is from -32768 to 32767. Get with the times, it looks like your machine has 32-bit ints, not 16-bit. >why it is not like -32768 to 32768, why there is a gap It's … | |
Re: Translation: Will somebody do my homework for me? Answer: No, but if you show us what you've done, we might be able to help you improve your design. | |
Re: >I just want to hit one key and not enter the option then have to hit the enter key. There's no portable way to do this. You have to rely on a non-standard function like getch. | |
Re: >I figured I'd use something like an array to hold the points Since this is a graph problem, so you need to hold the identity of the vertex (A, B, C, etc...), the the vertices that a vertex is connected to through an edge (A->B, A->C, B->C, etc...), and the … | |
Re: Read the file like normal, then decrypt it. It's a trivial task if you know how it was encrypted and have all of the necessary keys. | |
Re: >this can be done in C# with great ease Oh good. Show us how you do it in C# so we know what the hell you're talking about by a "unique number". | |
Re: So...did you even bother to read any book on C before running here? >using the "gets" statement Don't use gets, it's completely unsafe. | |
Re: What did you change? Please don't expect us to believe that Microsoft's compiler fails to compile Microsoft's default generated code. | |
Re: Multiple books have been written on how to use Visual Studio. Don't expect that kind of coverage in a forum thread. In fact, I'd recommend you go out and get one of the books. | |
Re: 1) You know the size of the table and you can keep track of the load factor by modifying a counter when you add or remove a chain. This is pretty efficient. 2) Separate chaining is much more friendly when it comes to table size. Making it too small isn't … | |
Re: >i dnt knw how to design good UI The only fix for that is practice. | |
Re: >I thought thats what vectors were for. And how did you think vectors were implemented? You simulate a dynamically sized array through pointers and new: [code] // First allocation T *p = new T[N]; ... // Resize by creating a new array T *save = new T[N * 2]; // … | |
Re: Primitives and bitfields are a part of the language, there's no header. Why don't you describe what you're trying to confirm instead of asking a vague question. | |
Re: >So I'm just wondering are these questions a little bit too complicated for >some people to answer of are everyone looking just for answers as well. It's a combination of not knowing the answer, or not feeling compelled to answer. I [I]could[/I] answer lot of the questions in the forums … | |
Re: Um, board isn't a member of the GameBoard class. It's a global variable. | |
Re: >theres a special function for it? Nope. The usual suggested solution is to programmatically simulate Alt+Enter. I do believe that searching our forums will give you the code to do so. | |
Re: What language are you doing this in? | |
Re: >I want to alloc dynamically the number of nodes and also the length of s in node struct Do it separately: [code=c] struct node *x = malloc ( nodeMAX * sizeof *x ); int i; for ( i = 0; i < nodeMAX; i++ ) x->s = malloc ( sMAX … | |
Re: >allow 10 accounts to be opened and then allow the user to search >for each one and deposit and withdraw from each one Well, start by allowing one account and work up from there. As a first attempt, I would suggest an array of account class objects. You need to … | |
Re: >So there's absolutely no way possible for the average person to write to it? Why in the world are you even asking how to crash Windows by corrupting the kernel? | |
Re: >im actually programming in C Then keep in mind that C89 doesn't support the <iostream> header, namespaces, or the true keyword. Your code won't compile as C, and failing to return a value from main is undefined behavior. >wat is the equivalent statement in C++? I thought you were programming … | |
Re: It might help to describe how the game works and how your program logic accomplishes that. Saying that you need some code for the program to ignore a 3rd number that's pulled up means nothing to us. | |
Re: >I'm pretty sure it's not possible It's possible, but not like that. You can have a pointer or a reference to the class being defined: [code=cplusplus] class X { X *m_member; }; [/code] |
The End.