1,684 Posted Topics
Re: The reason is that [icode]blah = 1[/icode] sets the lvalue [icode]blah[/icode] to 1. You want [icode]blah == 1[/icode], which evaluates to true if blah is 1. It's generally a good idea in C++ to get in the habit of putting constants like 1 on the left-hand side of equality comparisons. … | |
![]() | Re: You'll probably get a dumb generic answer, asking a question like that in this forum. Here is mine: C# is a fine general-purpose programming language. You might not have the same access to numerical libraries as you do with, say, Matlab or C++. If you want to write code for … |
Re: Where you wrote [icode]ostream &Month::operator<<(ostream &strm, const Month &obj)[/icode], you should be writing [icode]ostream &operator<<(ostream &strm, const Month &obj)[/icode]. The function you're defining is not declared as a member function of the Month class. Edit: (The same goes for your operator>>.) | |
Re: [quote]I want to use these two terms appropriately.[/quote] Why? | |
Re: It depends on the users you have. Most sites accept some standardized syntax for input. For example, Daniweb lets you use LaTeX: [tex]\int_{-\infty}^\infty f(t) e^{- i t \omega}\,dt[/tex] If you needed to parse the expressions and do computation or manipulation with them, you might use a different, simpler syntax. The … | |
Re: Could you post the contents of client.h? It might be needed just to sanity-check things. | |
Re: Read your lecture notes and read your textbook. Write simpler programs and grow them into something bigger with progressive, understandable modifications. | |
Re: Wikipedia seems to have the bit-level details. | |
Re: [QUOTE=elpablo;790169] You see scheme. So I need a recursive class or something like that. [/QUOTE] What the fuck is a recursive class? What the fuck are you talking about? | |
Re: Why do you have a class named Swap? | |
Re: [QUOTE=NeoKyrgyz;792146]You may want to implement your own Double Class (which will hold data as a string internally)[/QUOTE] Or how about a better representation. | |
Re: You're not describing what you expect the code to do. I would expect the code to fill the array with threes. | |
From [url]http://www.daniweb.com/forums/thread172120.html#post791196[/url] : [quote=Ezzaral]On a side note, never throw exceptions from main(). Use a try-catch block.[/quote] Why? | |
Re: You can look inside the file and see what's there. If it conforms to your expectations -- if the file or the first 1000 bytes of the file contains only characters that conform to one of some particular set of character encodings, maybe you have a text file. | |
Re: He is not a mean. Did you even read the conversation? | |
Re: [QUOTE=SAZAR;791185]If there is not such utility - then - can someone make it - because it's a simple task for a programmer - surely - a small exercise.[/QUOTE] Then why don't you make it? | |
Re: Flow charts are basically an awful way to design a program and an awful way to represent the design of a program. If you asked me to name any "good" ways to _represent_ the design, I couldn't. But I think type systems are pretty good. The very idea of just … | |
Re: [quote] i'm trying to insert comparecount and movecount in the program. [/quote] I do not understand this sentence. | |
Re: You can usually find answers on wikipedia. [url]http://en.wikipedia.org/wiki/Hamiltonian_path_problem[/url] | |
Re: Why are you using C++/CLI and not something like C#? | |
| |
Re: You could, say, make an application for easily designing (and running) _______ simulations in ______ environment. Insert an appropriate word pair like ("swimmer", "low-reynolds newtonian fluid"). That's more on the computational end of the spectrum -- depending on your department's definition of "applied mathematics" that might be fine. (My math … | |
Re: Applications run by the operating system can't access hardware directly. Instead, they have to access it through system calls, and there is some sort of protection that prevents them from doing things like, say, writing random bytes to the hard disk or sending arbitrary signals to the ethernet device. This … | |
Re: Why do you say static variables will be disposed of at the end of the function call? | |
Re: No, and even if it were possible, it would be completely counterintuitive. Also, it's completely unnecessary. Instead, pass a parameter that tells how you want the function to behave. | |
Re: The "From" header contains the alleged email of the sender, yes. | |
Re: Your function random is broken! This is an awesome bug. It's broken in two ways. First, it's broken because rand() may return RAND_MAX. In such a case, your random function is clearly broken, because it will return the value ceiling. So the quick fix is to divide by [icode]RAND_MAX + … | |
Re: [QUOTE=LizR;789390]cool - please mark it as solved[/QUOTE] Why are you so keen on having people mark threads as solved? | |
I would like to take a poll of what version of C# and .NET you are used to working with. I'll start. C# 3, .NET 3.5. | |
Re: You can't do it; the size of the array needs to be specified in the class declaration. If you want something variable-sized, use a vector. | |
Re: Your problem is that you're recreating the file every time through the loop. Thus, the old data gets replaced. | |
Re: Garbage collection is the most important, and outweighs the combination of all other advantages. C# has anonymous functions, i.e. closures, which outweighs the combination of all the advantages below. C# has an actual module system. C# has generics, which are more powerful in some ways than C++'s compile-time template system, … | |
Re: C++ has a more flexible template system that can do things (like take template classes as template parameters) that C#'s generics system just can't do. Its use of RAII is nice, too. It has a bunch of good libraries, like boost, and you can more easily write cross-platform applications with … | |
Re: If you're worried about maps, don't worry at all. They will scale just fine. If you ever finding yourself wanting to eke out that last bit of performance, it should be easy to plug in various other implementations like hash tables or such. Consider using typedefs so that you would … | |
Re: There are none. Well, there are a few. If you don't have a C++ compiler that targets the platform you're looking for, or if you're working on a project (that somebody else started) that uses C liberally. Also, if you're making a few low-level functions that will get called via … | |
Re: Well, error catching is what try-catch blocks are for... But if you're talking about some pointer-related bug, the right answer is to avoid using pointers directly in the first place. I don't know what your program is trying to do -- why are you deliberately indexing past the end of … | |
Re: [QUOTE=da penguin;788390]Yes, it does remain. If new operator is used u need to delete explicitly.[/QUOTE] What the fuck are you talking about? When the program ends, nothing remains. | |
Re: Why would you want code for a chatbot? Go die, cheater. | |
Re: This is a C question and belongs in the C forum. | |
Re: An image is just a two dimensional array of colors. A color could be represented a number of ways, one of which is to give brightness levels for red, blue, and green that range from 0 to 255. An example image file could be (in hexadecimal) [code] 00 00 00 … | |
Re: Back when I had no clue what "object oriented" meant, I looked at C# and was able to make reasonable applications with it. It's a comfortable language. | |
Re: [quote=jbennet]any pointers?[/quote] I'll pardon the pun. Do you want it for a singly linked list or a doubly linked list? I'll consider doubly linked. Say you've got three nodes (which contain a value and left and right pointers), at locations W, X, and Y: W={value:_; left: V; right: X} X={value:_; … |
The End.