1,684 Posted Topics

Member Avatar for neoseeker191

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. …

Member Avatar for soroushc
0
137
Member Avatar for CsharpBeginner

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 …

Member Avatar for BlackSun
0
1K
Member Avatar for rosenberg_a

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>>.)

Member Avatar for rosenberg_a
0
115
Member Avatar for serkan sendur
Member Avatar for Rashakil Fol
0
51
Member Avatar for Justmehere

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 …

Member Avatar for Justmehere
0
120
Member Avatar for cylow22
Member Avatar for cylow22
0
106
Member Avatar for abby2589

Read your lecture notes and read your textbook. Write simpler programs and grow them into something bigger with progressive, understandable modifications.

Member Avatar for Rbezona
0
103
Member Avatar for Rbezona
Member Avatar for elpablo

[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?

Member Avatar for elpablo
0
166
Member Avatar for serkan sendur
Member Avatar for daviddoria

[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.

Member Avatar for Rashakil Fol
0
116
Member Avatar for dmanw100

You're not describing what you expect the code to do. I would expect the code to fill the array with threes.

Member Avatar for dmanw100
0
145
Member Avatar for Rashakil Fol

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?

Member Avatar for ~s.o.s~
0
151
Member Avatar for ishaanarora
Member Avatar for BobLewiston

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.

Member Avatar for Ramy Mahrous
0
114
Member Avatar for Jaycee
Member Avatar for SAZAR

[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?

Member Avatar for GDICommander
0
136
Member Avatar for LucyB

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 …

Member Avatar for Rashakil Fol
0
104
Member Avatar for avillachandok

[quote] i'm trying to insert comparecount and movecount in the program. [/quote] I do not understand this sentence.

Member Avatar for avillachandok
0
99
Member Avatar for edadma
Member Avatar for hanou88

You can usually find answers on wikipedia. [url]http://en.wikipedia.org/wiki/Hamiltonian_path_problem[/url]

Member Avatar for Rashakil Fol
0
48
Member Avatar for 0av067
Member Avatar for erms
Member Avatar for odonal01
Member Avatar for androidodnetnin

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 …

Member Avatar for Rashakil Fol
0
145
Member Avatar for viniciusweb

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 …

Member Avatar for Rashakil Fol
0
147
Member Avatar for CcXD
Member Avatar for mannyg
Member Avatar for serkan sendur
Member Avatar for Rashakil Fol
0
165
Member Avatar for daviddoria

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.

Member Avatar for Rashakil Fol
0
132
Member Avatar for azylym
Member Avatar for Rashakil Fol
0
55
Member Avatar for mpeters13
Member Avatar for code46

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 + …

Member Avatar for code46
0
214
Member Avatar for OrderChaos

[QUOTE=LizR;789390]cool - please mark it as solved[/QUOTE] Why are you so keen on having people mark threads as solved?

Member Avatar for Ramy Mahrous
0
1K
Member Avatar for Rashakil Fol

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.

Member Avatar for hieuuk
0
146
Member Avatar for serkan sendur

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.

Member Avatar for serkan sendur
0
13K
Member Avatar for Yaserk88

Your problem is that you're recreating the file every time through the loop. Thus, the old data gets replaced.

Member Avatar for Yaserk88
0
132
Member Avatar for gsingh2011

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, …

Member Avatar for ddanbe
0
841
Member Avatar for gsingh2011

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 …

Member Avatar for d0pedup
0
297
Member Avatar for thelamb

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 …

Member Avatar for thelamb
0
182
Member Avatar for gsingh2011

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 …

Member Avatar for Salem
0
104
Member Avatar for mtucker6784

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 …

Member Avatar for Rashakil Fol
0
138
Member Avatar for serkan sendur

[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.

Member Avatar for Free_Classified
0
470
Member Avatar for naomiauk
Member Avatar for clutchkiller
Member Avatar for sciwizeh
Member Avatar for New IT Student

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 …

Member Avatar for Salem
0
106
Member Avatar for chound

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.

Member Avatar for Salem
0
639
Member Avatar for honey.c
Member Avatar for jbennet

[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:_; …

Member Avatar for jbennet
0
107

The End.