3,183 Posted Topics

Member Avatar for Weliaz

You need to include a header with the declaration of XMLElement (not to mention <string> for the std::string class). Just because the library is linked doesn't mean the compiler won't complain about unrecognized types.

Member Avatar for Weliaz
0
335
Member Avatar for coolerking

You have to be *really* careful when treating strings as raw memory and vice versa because raw memory can have legit embedded null characters. The problem you're having is basically you stop processing on a null when you should keep going. I made a few changes that fix your problem. …

Member Avatar for deceptikon
0
161
Member Avatar for softwaretime

Are precompiled headers enabled for the project? That's what stdafx.h is, all of the standard headers precompiled into one so that you don't have to include them as needed. The down side is that your code is closely tied to the compiler. Ideally you'd disable that feature and include <iostream>.

Member Avatar for softwaretime
0
268
Member Avatar for needhelpalways

Do you know how to write an `if` statement? There are three cases: if (number == 0) printf("0"); else if (number < 0) printf("-1"); else /* number > 0 */ printf("1"); Easy peasy.

Member Avatar for Nutster
0
299
Member Avatar for kidpro

> Sorry for providing a bad practice. Apologies in advance, but that's not the worst practice in your example. My vote would go to this gem: for(loop = 0; loop < strlen(string); loop = loop + 1 ) The inner loop exhibits the same problem, which is calling strlen() in …

Member Avatar for Miorfs
0
159
Member Avatar for LastMitch

Love it! Such a simple thing, but seeing who solved it and when is handy info.

Member Avatar for Dani
4
220
Member Avatar for agca
Member Avatar for deceptikon
0
103
Member Avatar for nathaniscool99

Does the constant *have* to be private? It seems silly to require it to be private and also require it to be accessed directly from outside of the class.

Member Avatar for deceptikon
0
269
Member Avatar for saurabh.mehta.33234

> Does the following code make p as a null pointer Yes. Static variables are zero initialized, which for pointers means the equivalent of NULL. You can verify that this is the case (other than reading the standard documentation) with a simple test: #include <stdio.h> static int *p; int main(void) …

Member Avatar for deceptikon
0
157
Member Avatar for nuclear

By dropping down a level, you need to handle lower level concerns like string termination: ob.read(word, sizeof word - 1); word[ob.gcount()] = '\0';

Member Avatar for vijayan121
0
187
Member Avatar for Mike Askew

> So what do you do to pass the time at work when it becomes a bit quieter and you have nothing else to do? Posting on Daniweb, working on Daniweb's code, surfing the web, personal projects, etc...

Member Avatar for Bob Hensley
0
186
Member Avatar for arohideep13

The winner for me is Everquest 2. I started playing at launch (2004) and never stopped. Amazingly enough, the game is still interesting and I put a lot of time into it. > I actually preferred Oblivion to Skyrim Me too. Maybe it's because I burned myself out on Oblivion …

Member Avatar for Bob Hensley
0
296
Member Avatar for pmphaololi

Please read our rules concerning homework. Simply posting your homework question is a good way to have the thread deleted.

Member Avatar for deceptikon
0
95
Member Avatar for khushhappy

It looks straightforward. Are all records separated by multiple blank lines? Really all you'd be doing is writing an algorithm to read a record and write some of the data onto a single line of output. My very first programming job was writing report filters almost exactly like that in …

Member Avatar for deceptikon
0
90
Member Avatar for Shft

At least you waited a whole 11 hours before complaining about not getting help. Keep in mind that the forum is a volunteer effort. If you want to guarantee immediate help, you'll need to find a paid support service. I also notice that two of your articles are not trivial …

Member Avatar for kevinp2012
-6
211
Member Avatar for eharrell

> Anyone willing to assist? Willing yes, but not capable with such a vague description of what you want to do and the problems you're having.

Member Avatar for Reverend Jim
0
322
Member Avatar for Carpetfizz

Anytime you get a large negative number, there are two things to check straight away: 1. Any uninitialized variables in your math. 2. Any out of bounds indexing or invalid pointers (they can corrupt other variables). Either way the problem isn't in rand(), it's your code doing something funky.

Member Avatar for Carpetfizz
0
148
Member Avatar for super-duper

Network places isn't a directory, it's more of an ad hoc listing of visible network devices. You can get a similar listing with the `net` command: `C:\>net view`. Or use the `/?` argument to get a summary of arguments for `net`.

Member Avatar for JorgeM
0
144
Member Avatar for <M/>

Seems okay on my end. What browser and OS? Did you try clearing your cache and doing a hard refresh of the page?

Member Avatar for <M/>
0
80
Member Avatar for joru819

> Do you guys have any advice for me? Probably nothing you haven't already heard. > If you could do it over again what would you have done differently? Most certainly, I would have. If I knew what I know now, I'd probably not have gone the IT/developer route and …

Member Avatar for JorgeM
0
210
Member Avatar for vishalonne

2D arrays aren't a single entity like in some languages, they're arrays of arrays. What you're actually trying to allocate here is a pointer to `size` arrays of `size` int, and the destination type needs to reflect that: int (*b)[size] = new int[size][size]; This is assuming `size` is a const …

Member Avatar for deceptikon
0
140
Member Avatar for sddq_bll

It's a program with a menu of user options in the interface that guides what the program does. There's no magic or complex logic here, it's just a simple menu.

Member Avatar for amrita111
0
272
Member Avatar for xikhari.some1behindu

The loops are a red flag for me because they count from 1 to `n` instead of from 0 to `n-1`. C# arrays are zero based, so even if `n` represents a safe limit for the array, you're still looking at an off by one error.

Member Avatar for deceptikon
0
215
Member Avatar for Vegito1991

Automagic synthesis of a default constructor is disabled when you provide any explicit constructor. If that explicit constructor has arguments and not all of them are defaulted, then your class will not support a default constructor unless you explicitly define one. Your class has a seven argument constructor, so the …

Member Avatar for Vegito1991
0
125
Member Avatar for chandnigandhi

[This article](http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048384015&id=1043284392) may help you with using the directional keys. Turbo C supports the getch() based solution. Note that it *only* describes how to capture and respond to those keys. What you do in the response is where most of the real work lies. ;)

Member Avatar for deceptikon
0
153
Member Avatar for AbaianitCristian

How are you calling the C++ program? Is it C++/CLI and a .NET assembly or are you using COM? Or are you just calling a program that happens to be written in C++?

Member Avatar for BobS0327
0
205
Member Avatar for dayana.shakra

No. Daniweb is not your personal homework service. We require that you make an honest attempt to solve the problem. Please read our rules.

Member Avatar for deceptikon
0
31
Member Avatar for ulrik m.

One possible effect of undefined behavior is producing the expected result. That's why it's so difficult to explain to someone whose program is working that it's broken and wrong.

Member Avatar for ulrik m.
0
314
Member Avatar for Shft

The easy solution is to not use gotoxy(). It's a Borland holdover from the days of yore where 640K wasn't a laughably small amount of memory. Get with the times and write a *real* GUI if you need more control than the command prompt provides. Alternatively, you can [search google](http://lmgtfy.com/?q=code%3A%3Ablocks+gotoxy). …

Member Avatar for deceptikon
0
136
Member Avatar for Shft
Member Avatar for deceptikon
0
189
Member Avatar for JohnMcPherson

Please post a small program that exhibits the problem and a sample of your CSV file. scanf() format strings can be tricky, and scanf() is usually unsuitable for true CSV, but if it's just a naive comma separated format without embedded commas, you can get away with using scanf().

Member Avatar for JohnMcPherson
0
6K
Member Avatar for Reverend Jim

> No one said you have to use intellisense. I don't use it, or very seldom use it. I don't use it for C or C++, but for C# and VB.NET it's mighty handy (and actually works). > As for the debugger, I use it often. The debugger is the …

Member Avatar for deceptikon
0
254
Member Avatar for taylor.mitchell.353

> From what I understand is Java is mostly understanding, implementing, and manipulating algorithms. That's universal, it's not unique to Java. > To me this seems like I just used a simple algorithm to obtain the desired result. In my opinion, a good professional would start with the simplest algorithm …

Member Avatar for taylor.mitchell.353
0
184
Member Avatar for Echo89

Neither of those are an equivalent to PHP's explode(). To do it thoroughly you'd need to include all of the logic for the limit and any edge cases that affect the result. I hacked this up pretty quickly from the PHP manual's definition, but it should be close: #include <cstdlib> …

Member Avatar for Echo89
0
991
Member Avatar for kostaskol

You need to validate the password completely, *then* display the output: #include <stdio.h> int main(void) { const char *pass = "letmein"; int ch; // int, not char! while ((ch = getchar()) != '\n') { if (ch != *pass++) break; } if (*pass) puts("Invalid password"); else puts("Welcome!"); } Note that your …

Member Avatar for kostaskol
0
124
Member Avatar for TheSmartOne1

Delete line 6, you're hiding the global variable with a local variable. Any changes to the local variable are lost on each iteration of the loop.

Member Avatar for deceptikon
0
74
Member Avatar for adlinaalbert
Member Avatar for deceptikon
1
36
Member Avatar for daino
Member Avatar for ravenous

When creating a new article you can select both the type and the forum. So if you're posting from the C++ forum, the selected forum for the new article will be C++, but you can change it using the selection list before posting. I imagine that as a more general …

Member Avatar for mike_2000_17
0
193
Member Avatar for aaal

What do you mean by "does not work"? If you mean that it doesn't sort the array properly, then your radix sort is broken and you need to check the algorithm. Perhaps compare what you're doing logically with a [working radix sort](http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#radix).

Member Avatar for deceptikon
0
176
Member Avatar for Daniel BE

> I used eof() and good() function but there is no change in the output. They're both wrong, so I'm not surprised. The problem is that both eof() and good() will only switch state *after* you've tried to read from the file and that attempt fails. So you need some …

Member Avatar for deceptikon
0
253
Member Avatar for idah19
Re: FYP

What is "FYP"? Anyway, if you're looking for a fuzzy string comparison then a good start would be with [Levenshtein distances](http://en.wikipedia.org/wiki/Levenshtein_distance) or [Soundex](http://en.wikipedia.org/wiki/Soundex).

Member Avatar for idah19
0
131
Member Avatar for gaurav9219

I don't want to tell you to give up, but judging from your question I'd say the likelihood of failure in this project is near 100%. Have you done *any* research before running for help?

Member Avatar for deceptikon
0
66
Member Avatar for amras123

The error suggests that mysql_query() returned FALSE as mentioned is one possible return value [here](http://php.net/manual/en/function.mysql-query.php). You need to extract more information to properly diagnose the failure: $query = ''SELECT * FROM internet_shop'; $result = mysql_query($query); if (!$result) { die("'$query' failed with error: " . mysql_error()); }

Member Avatar for deceptikon
0
91
Member Avatar for ranam

Your base class is undefined. Check your spelling, then check to make sure that you're including the appropriate files and have appropriate declarations in place. Your question lacks necessary information to help any further.

Member Avatar for ranam
0
115
Member Avatar for Archaismic

That's actually a good question because you've stumbled on a subtle behavior of keybd_event(). What it does is queue up key presses to the program with focus. In this case that program is itself (confused yet?). The problem is that this program isn't listening for input, and doesn't ever listen …

Member Avatar for Archaismic
0
209
Member Avatar for diluadamu

> how to install window I can't imagine how anyone would think that's a coherent question. Try again.

Member Avatar for <M/>
0
61
Member Avatar for theguitarist
Member Avatar for hwoarang69

> may be i can download unix, linux on CD or some program that let me do this. There are distros of Linux (such as Knoppix) that can be run from a live CD. Do a google search for "Linux live CD" and you'll get plenty of hits.

Member Avatar for ORAfreak
0
294
Member Avatar for Wh1t3gh0st

Everything you get from the keyboard is a character. To extract an integer you need to read multiple characters and append them to an integer value, or store them as a string and then subsequently convert that string to an integer value. Either way you're doing a string to integer …

Member Avatar for Wh1t3gh0st
0
105

The End.