6,741 Posted Topics

Member Avatar for Muhammad Anas
Member Avatar for Muhammad Anas
0
1K
Member Avatar for Suzie999

[QUOTE]How can I get a new line in messagebox?[/QUOTE] Try using "\r\n" instead of just "\n".

Member Avatar for Suzie999
0
432
Member Avatar for anjoz

There's nothing you can do in this situation. The file needs some kind of formatting to differentiate between codes, such as a separator or a guaranteed field width. If you can have codes of varying length all mushed up next to each other and no way to determine where the …

Member Avatar for Narue
0
2K
Member Avatar for forumposters

>I'm new to C++ and any help would be appreciated. At least start trying to solve your problem before asking for help. It makes us like you more and ignore you less.

Member Avatar for yashsaxena
0
796
Member Avatar for Muhammad Anas
Member Avatar for Muhammad Anas
0
159
Member Avatar for zeronis

Just because you can cast an object to a pointer to char doesn't mean it's safe. Unless your class is [URL="http://en.wikipedia.org/wiki/Plain_old_data_structure"]POD[/URL], punning to a byte stream is begging for data corruption.

Member Avatar for Narue
0
221
Member Avatar for theguitarist

[QUOTE]When char can take integer values from -128 to 127 and both 290 and 20000 are welll out of this range[/QUOTE] First, there's no requirement for char to have that particular range. Second, when char is signed, overflow results in undefined behavior. Your code is very dangerous. In your case, …

Member Avatar for pseudorandom21
0
130
Member Avatar for karthik_ppts
Member Avatar for vedro-compota

The underlying problem is failure to include <stdlib.h> and using the abort function without a visible prototype.

Member Avatar for vedro-compota
0
520
Member Avatar for tubby123

The best cast for quicksort is an already sorted array when the implementation checks for an already sorted subset. In such a case, no partitioning takes place and no recursive calls are made, which results in linear complexity: [code] function quicksort(a, first, last) if is_sorted(a, first, last) then return end …

Member Avatar for mrnutty
0
228
Member Avatar for Prabakar
Member Avatar for Geek-Master

[code] #include <vector> std::vector<std::vector<T> > mat; [/code]

Member Avatar for Hialek
0
5K
Member Avatar for Ymor

>void main() *smack* Main returns int. >atm it crashes when i type in JACK ROBINSON or any incorrect data... I can answer your question with another question: Where do your pointers point? If you said "I don't know", you're right, and that's why your program crashes.

Member Avatar for WaltP
0
240
Member Avatar for martin111

[QUOTE]I cannot see why this should give an error, the base class pointer reference is declared as referring to constant pointer memory.[/QUOTE] The problem isn't about const, it's about an added level of indirection. a_t** and b_t** are incompatible types; you were expecting polymorphism to be recursive through all levels …

Member Avatar for mike_2000_17
0
302
Member Avatar for heshan86
Member Avatar for eskimo456

Is the particlesToRender array (assuming it's an array) being used polymorphically?

Member Avatar for eskimo456
0
152
Member Avatar for iamthwee

[QUOTE]I don't see whats wrong with good ol' C++.[/QUOTE] One example, two words: string processing.

Member Avatar for MosaicFuneral
0
166
Member Avatar for kutuup

Some more code would be helpful, like the relevant part of your main(). The only errors I see as far as class setup goes are that your constructor and destructor have return types, which isn't allowed.

Member Avatar for kutuup
0
1K
Member Avatar for FoxInBoots

[QUOTE]This is an example in my book but I don't understand where you get the value for "A", "C" or "rad" when it's not given a value anywhere in the code. I feel really stupid, that I don't get it.[/QUOTE] Let's use a simpler example and focus on how functions, …

Member Avatar for FoxInBoots
0
162
Member Avatar for yashsaxena

[QUOTE]Abstraction means Giving only essential things and hiding unnecessary details.[/QUOTE] Implementation details are often hidden away behind a more intuitive interface in abstraction, but that's not required. Abstraction is the process of matching the representation of data or algorithms to their meaning within a program. It's a method of implementing …

Member Avatar for yashsaxena
0
4K
Member Avatar for caut_baia

[QUOTE]I'm such a bad person .. :-<[/QUOTE] Votes are a pretty subjective thing. You're more likely to get frivolous votes because they're anonymous (haters like this) and don't apply toward reputation (people with strong negative power tend to like this). I doubt anyone thinks you're a bad person because you …

Member Avatar for caut_baia
1
171
Member Avatar for shilosimi

[QUOTE]The thing is i don't want to scan the entered data to a temporary variable and then put it into the file[/QUOTE] Why not? [QUOTE]Is there any way to do so?[/QUOTE] Nope. At some point during the process you'll be using memory. [QUOTE]If not, what is the most efficient (memory-wise) …

Member Avatar for Narue
0
239
Member Avatar for TrustyTony

[QUOTE]still I did not figure out how to get rid of the array limit MAXDATA of number of records.[/QUOTE] Maybe that's a hint that you shouldn't be using an array to store records. ;) For an address book, searching is the primary task, so a data structure that supports dynamic …

Member Avatar for Narue
0
1K
Member Avatar for usedtoworkhere

New posts have been split into a new thread. usedtoworkhere, please don't resurrect an existing thread unless you have relevant information which adds to the discussion. "Me too" posts are better served with a new thread to avoid confusion in the case of similar but unrelated issues. I'll also ask …

Member Avatar for mo12lan
0
280
Member Avatar for ravenous

[QUOTE=iamthwee;1567326]Nice work. But generally people want to KEEP single spaces and remove more than double spaces. [url]http://www.daniweb.com/software-development/cpp/threads/106452/518972#post518972[/url] Also look into writing a trim function. [url]http://www.daniweb.com/software-development/cpp/threads/155472/729101#post729101[/url][/QUOTE] Maybe we can steal Apple's catch phrase and modify it for C++: "There's an algorithm for that". [code] #include <algorithm> #include <cctype> #include <iostream> #include …

Member Avatar for Narue
1
2K
Member Avatar for Dani
Member Avatar for yashsaxena

gets() is broken by design and you should use fgets() instead, but unless "program not run" means you're scared of a compiler warning to that effect, fgets() will likely suffer the same issue because the problem is in [B]your[/B] code or [B]your[/B] assumptions about the environment. You should learn to …

Member Avatar for WaltP
0
1K
Member Avatar for darkdai

[QUOTE]whether or not you use command-line arguments for this program, you should get in the habit of defining your main() as:[/QUOTE] Why define parameters that aren't used? You're lying to readers of your code by saying that you'll use command line arguments and then not using them. Not only does …

Member Avatar for Narue
0
113
Member Avatar for saqib_604

The [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]Member Rules[/URL] link is at the top right of every page just above the search box, along with the link to your control panel.

Member Avatar for Ezzaral
0
189
Member Avatar for 123priya

Are you asking a question, or just showing off your substandard programming abilities?

Member Avatar for tkud
0
95
Member Avatar for eman 22

I'm not sure you're using "order" the way it's usually used. The order of a B+ Tree refers to the maximum number of children an internal node could have. Can you be more specific as to what you're asking?

Member Avatar for rubberman
0
128
Member Avatar for n0de

It works the same way with vectors. But since vectors grow dynamically, be extra careful that the index isn't out of bounds.

Member Avatar for mike_2000_17
0
94
Member Avatar for eman 22

Take the <T> part out of your forward declarations. You're just declaring a templated name, not instantiating it. Technically, you could do this since the template parameter name isn't used: [code] // Forward declare Foo<> template <typename> class Foo; [/code]

Member Avatar for mike_2000_17
0
341
Member Avatar for GamerXxX

I'm sorry, you have the wrong forum. I believe you were looking for the [I]psychic friends forum[/I].

Member Avatar for GamerXxX
0
140
Member Avatar for FoxInBoots

Try putting another loop inside of your present loop where the outer loop handles rows and the inner loop handles columns.

Member Avatar for FoxInBoots
0
69
Member Avatar for strungoutfan78

Shall we start with the fact that the standard string class is in the std namespace? You're treating it as if it's in the global namespace.

Member Avatar for strungoutfan78
0
172
Member Avatar for elshan0011
Member Avatar for can_surmeli

Sorting a binary search tree means rebuilding it completely, because the structure depends on a relational comparison of the key. If your address book isn't large, you'd probably be better off simply using an array and sorting it as necessary, with a binary search (bsearch) to keep lookups snappy. If …

Member Avatar for TrustyTony
0
718
Member Avatar for ekailan

[QUOTE]You can not increase the memory of a system using a file.[/QUOTE] It's called virtual memory. By paging blocks in and out of files, you can expand the perceived limitation of RAM at the cost of performance. Modern operating systems will typically do this already, but if you're on something …

Member Avatar for predator78
0
114
Member Avatar for jingda

[QUOTE]Is there an IT meetup also but online, so other posters around the world can participate.[/QUOTE] Have you tried our IRC chat room?

Member Avatar for Narue
0
250
Member Avatar for shylesh_kerala
Member Avatar for antechindia
-1
132
Member Avatar for rameshbadi

I can't believe nobody mentioned that you need to include string.h. :icon_rolleyes: :D

Member Avatar for Ancient Dragon
0
439
Member Avatar for m2cm
Member Avatar for m2cm
0
28
Member Avatar for jowana

The usual solution is: [code] cin.ignore(N, '\n'); cin.get(); [/code] Where N is a suitably large number for clearing extraneous characters from the stream.

Member Avatar for sergent
-1
213
Member Avatar for sergent

Your personal feelings on the matter match our policies. Homework questions are fine, provided the student puts forth some effort and doesn't expect helpers to do the work. On the other side of the coin, helpers should refrain from giving away homework answers which tempts students to cheat and is …

Member Avatar for sergent
0
84
Member Avatar for jordan0420

Objective-C is different enough from C that posting questions in the C forum probably wouldn't buy you much. For languages without a dedicated forum, the Legacy and Other Languages forum is there as a catch-all. Or if you can find enough people interested in an Objective-C forum, Dani may be …

Member Avatar for sergent
0
495
Member Avatar for infiniteloop56

[QUOTE]the following code that I have written only takes me about half way there[/QUOTE] Excellent. Now do the same thing again, but this time reverse your starting and ending points, and count down instead of up.

Member Avatar for goldzero
0
1K
Member Avatar for vivekchandra

[QUOTE]yeah close it....[/QUOTE] I think I'll go ahead and do that. This thread isn't likely to go anywhere except a downward spiral. [QUOTE]tell how to delete you a/c[/QUOTE] Accounts aren't deleted so that Daniweb can conform to anti-spam laws. You can simulate the effect by removing all personal information and …

Member Avatar for Narue
0
181
Member Avatar for Muhammad Anas

Formatted input (with the >> operator) and unformatted input (getline is an example) don't play well together. It's a subtle combination of features that work together to give you this bug: [list] [*]Requests only block (wait for you to type) if the stream is empty [*]Operator >> first discards leading …

Member Avatar for Muhammad Anas
0
2K
Member Avatar for gcardonav

Can you be more specific about when you want an blank line? Because as I see it, doing it at the same place as the [ICODE]stardId[i]==bestId[j][/ICODE] comparison will most certainly result in a lot of blank lines unless the two files correspond in the ID field.

Member Avatar for WaltP
0
223

The End.