2,045 Posted Topics

Member Avatar for samsons17

Your sentinel is given to you and is not a number so trying to compare your character to a number is not right. SENTINEL should be of type char and be equal to '.' It should become apparent based on what AD told you to what you should compare your …

Member Avatar for jonsca
0
424
Member Avatar for avirag

You mean for disposing of it? Run the edge of it through a good solid paper shredder(be careful to keep your fingers). Otherwise if you are trying to use it yourself how would you read it with a bad sector?

Member Avatar for avirag
0
96
Member Avatar for avirag

All of your reader/writer definitions should probably be wrapped in using() , e.g., [code] public string ReadWholeFile(string file) { //create a string variable to hold the file contents string fileContents; //create a new TextReader then open the file using(TextReader reader = new StreamReader(file)) { //loop through the entire file while …

Member Avatar for jonsca
1
206
Member Avatar for eliile5

[quote]this code is not mine, and i need to write somethink like this but not exactly this way. [/quote] That doesn't sound the least bit like you want us to help you cheat. There's one good way to do what you want to accomplish, try it yourself and come back …

Member Avatar for jonsca
1
204
Member Avatar for makdu

How about (I use a dictionary but you could use any container to keep track of the line numbers or strings): (you can flesh out the other portions -- I can't have all the fun) [code] bool found = false,last = false; //strdict is of type <int,string> while ((temp = …

Member Avatar for jonsca
0
2K
Member Avatar for sknake

[quote] I figured I would go ahead and introduced myself now. <snip> After being a member for a few months I have decided to stay. [/quote] I realize this is the resurrected part of the thread but it made me feel better since I had been (and still am lol) …

Member Avatar for redesignunit
0
175
Member Avatar for fadia

You are not getting any output because all the programs you have posted are calling decrement() but never displaying the value it returns. If you can output within your recursive function itself it will make things easier on you.

Member Avatar for fadia
0
132
Member Avatar for lewis1231

Here's the heart of it. Adding it to the listbox is a matter of taking the substring 8 characters long after the indicies found. Text is a string found by reading all of the text file until the end. [code] List<int> intlist = new List<int>(); string pattern = "te_"; int …

Member Avatar for jonsca
0
100
Member Avatar for DeathEater

[quote]i'm using windows xp and turbo c++ 3.1 and also 3.0[/quote] [quote]give me a clue that what is wrong with the compilers[/quote] Have you tried anything like mingw (included with Code::Blocks or standalone) or Visual C++? All of the above are free and much much more recent (to put it …

Member Avatar for jonsca
0
213
Member Avatar for JoaoC

First off, what is the actual problem at hand?? Secondly, what code have you tried so far to solve this problem?

Member Avatar for Nick Evan
0
94
Member Avatar for carey_amanda

[url]http://www.csharp-station.com/tutorials/Lesson15.aspx[/url] (or google C# try/catch for plenty more)

Member Avatar for jonsca
0
827
Member Avatar for phoenix_dwarf

I found a good article [URL="http://www.devsource.com/c/a/Techniques/High-Performance-Timing-under-Windows/1/"]here[/URL](see the QPC section). Windows has a certain amount of wiggle room between interrupts lowering the precision of the timing (I don't know much beyond that) and this is why people turn to embedded and real time solutions.

Member Avatar for phoenix_dwarf
0
157
Member Avatar for sathya8819

You can force garbage collection in your program. See: [url]http://msdn.microsoft.com/en-us/magazine/bb985010.aspx[/url] But also see this (and related opinions [I]against[/I] doing so on the web): [url]http://stackoverflow.com/questions/233596/best-practice-for-forcing-garbage-collection-in-c[/url]

Member Avatar for sathya8819
0
115
Member Avatar for CppBuilder2006

Can you use [icode] RectangleF rf = r.GetBounds(graphics);[/icode] then [icode] if(rf.Contains(p)) [/icode] do whatever? I'm assuming that graphics is of type Graphics and is initialized somehow.

Member Avatar for CppBuilder2006
0
149
Member Avatar for Sivyo

Pop in a second variable to keep count in your new array. [code] int j = 0; for (int i = 0; i < customer.Length; i++) { if (TypePerson.Manager || TypePerson.Vip) { importantCust[j] = customer[i]; j++; } [/code]

Member Avatar for jonsca
0
97
Member Avatar for zzbottom

[quote] should i not use arrays to do this? [/quote] Unless you know the exact number of records you will have (or it can be determined at runtime e.g, by the user entering a value), it is far better in most situations to use a list. Take a look at …

Member Avatar for jonsca
0
128
Member Avatar for jbarwick

See [url]http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.7[/url] . It's within the answer to another (not really related) question but the information is the same.

Member Avatar for Narue
0
280
Member Avatar for anakondaksa

Welcome. Is there a specific issue you are having with the program? Please let us know so we can help you better. EDIT: One change right away: [CODE]#include<iostream> //no .h for the C++ standard #include<cstdlib> //C++ version of header stdlib.h #include<cstring> //you were partly right[/CODE]

Member Avatar for jonsca
0
92
Member Avatar for safenaa

Welcome. Please read the following [url]http://www.daniweb.com/forums/announcement8-2.html[/url] and please note that we do not give "complete program"s.

Member Avatar for jonsca
0
39
Member Avatar for reyarita

What do you have so far (for the code)? Hint: You'll need to use "for."

Member Avatar for jonsca
0
155
Member Avatar for cwarn23

[icode] $year=floor($time/([B][I][U]360.25[/U][/I][/B]*24*60*60));[/icode] If you're going to be Captain Smartguy, you ought to have your numbers correct at the very least.

Member Avatar for vegaseat
-3
183
Member Avatar for MKO

[quote] I can't find anything wrong with it. [/quote] Never mind the fact that it doesn't compile, you have the syntax for printf and scanf completely wrong, and least of all it's some C/C++ hybrid program... For better or worse, the compiler is usually right.

Member Avatar for Salem
0
128
Member Avatar for Burnout

This is a better way to have it: Player.h [code] #ifndef PLAYER_H #define PLAYER_H #include <iostream> #include <string> using std::string; class Player { string name; int score; public: Player(); Player(string name); string Get_name(); void Set_name(string name); void Input_name(); }; #endif [/code] Player.cpp [code] #include "player.h" using std::cout; using std::cin; Player::Player() …

Member Avatar for pspwxp fan
0
126
Member Avatar for pink16

Take out a piece of paper and write out 2^2 in terms of 2, then 2^3 in terms of two, and to the fourth in terms of two until you see the pattern. Break the product 2 ^ n down into n steps, take what happens at each step and …

Member Avatar for jonsca
-1
91
Member Avatar for dchunt

[quote] Just find the amound of hertz. [/quote] Not entirely true. "CPU instruction rates are different to clock frequencies, usually reported in Hz, as each instruction may require several clock cycles to complete or may be capable of executing multiple independent instructions at once. Additionally, the number of cycles required …

Member Avatar for jonsca
0
834
Member Avatar for sara_sara

I may be missing something but in the inorder method, you have an if statement. Either path that you take calls the function recursively and there doesn't appear to be a stopping condition. One thing I noticed too on lines 29 and 159 you are trying to assign the value …

Member Avatar for Excizted
-1
95
Member Avatar for manosha

Hint: use your inner loop to control the spaces. (also please do yourself a favor and read [url]http://www.eskimo.com/~scs/readings/voidmain.960823.html[/url] ) about void main. main() should return an int. Make it a New Year's resolution) (and of course code tags...)

Member Avatar for jonsca
-2
92
Member Avatar for Karthika_g

There's no need to translate anything in terms of the DLL. See this link: [url]http://msdn.microsoft.com/en-us/library/aa288468(VS.71).aspx[/url] What do the header files contain? With the dll import you will be specifying your function prototypes right in the C# code. Any #defines can be translated into consts (or into methods if they define …

Member Avatar for sknake
0
150
Member Avatar for sknake

Similar to what I reported in [url]http://www.daniweb.com/forums/thread249581.html[/url] (there's a disparity in my solved threads too). If it's the same situation, it has to do with the mysterious "reported posts" forum which is visible to moderators. I'm not sure how we would get credit for threads solved there as we would …

Member Avatar for sknake
0
198
Member Avatar for jagan605

I'm surprised it didn't give you grief for pow, as there is no definition that takes 2 ints ([url]http://www.cplusplus.com/reference/clibrary/cmath/pow/[/url]) Look into fmod ([url]http://www.cplusplus.com/reference/clibrary/cmath/fmod/[/url]) which is like % but for floats/doubles/etc. Also, you should include <cmath> instead of math.h and main() should return an int. I ran the program but I …

Member Avatar for jagan605
0
199
Member Avatar for blue3hree

He's talking about the line numbers in your second program. Whichever one you are working with, get rid of all but one srand() call, which should be situated anywhere before the first call to rand() -- but preferably at the top of the program.

Member Avatar for zalezog
0
227
Member Avatar for MxDev

I think this is what you are looking for. I didn't test it with an application though. tbMessage is a rich text box and btnSend in this (pretend) example would send the text to the other conversant. SendMessage was added in just so the button would have an action. [code] …

Member Avatar for MxDev
0
73
Member Avatar for kizzer

I'm sure that there's some "pull the ripcord and the whole thing falls into a nice answer" approach, but I would just convert the base 8 to base 10 and make some guesses (e.g., you know it's not base 8) cause the two would be equal. That should give you …

Member Avatar for Seten
-1
247
Member Avatar for NargalaX

What does that particular segment of your code look like (if you're able to post it)? MathBot sounds interesting -- combing netspace to solve random equations it encounters. ;)

Member Avatar for NargalaX
0
287
Member Avatar for samsons17
Member Avatar for jonsca

My post total just jumped by about 50 since last time I checked this morning. EDIT: It only shows that in the profile. On my posts themselves it says the right amount.

Member Avatar for jonsca
0
327
Member Avatar for regist1

You are not the first person that has posted here to deal with this problem. Do a search on the forums. Hint, break the number that is input into pieces, going from largest to smallest. You probably know those pieces well, or if you don't look the system up on …

Member Avatar for tux4life
-1
211
Member Avatar for Kingfahad

Yes. What do you have so far? Please read [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for Ancient Dragon
-1
163
Member Avatar for rack

So what do you have so far? Even if you haven't covered this exact assignment I'm sure you have all the tools with which to tackle it. Can you write a menu with those selections and call an appropriate function for each (even if it's just a skeleton for a …

Member Avatar for jonsca
-1
119
Member Avatar for kelevra

Part of the problem is you want lcv == CHARCOUNT on line 36 -- you've traversed the entire array to the end and the character isn't there. Ignore what I said in my other edit about EOF, but make sure your user knows to hit EOF (ctrl-Z or F6) at …

Member Avatar for jonsca
0
124
Member Avatar for moroshko

Try taking the call out of InitializeComponent as I'm not sure it's considered part of myControl1. Try calling just plain Init() in the constructor of MyControl after InitializeComponent(). It's balking about that line because if Init() is not being called correctly the image is indeed going to be null.

Member Avatar for moroshko
0
624
Member Avatar for eduard77

For C++ QT is a decent library and it is somewhat portable (it's distributed by Nokia now). There's a free pdf of a decent book(released by the author under Open Publication) at [url]http://www.qtrac.eu/marksummerfield.html[/url] (the author's website). He steps you through (and they are nice manageable steps) making a very small …

Member Avatar for eduard77
0
202
Member Avatar for cthoes
Member Avatar for hussamo

[quote] Compare your post to the following statement: My car only makes noise when it runs. Please help me fix it. [/quote] Indeed, moreso the equivalent of parking one's car diagonally across the repair bays at one's local service station and leaving it overnight. (*the usual apologies for the bump …

Member Avatar for Ancient Dragon
-1
115
Member Avatar for Excizted

Under the Edit menu, Advanced, (uncheck) View White Space CTRL-R,CTRL-W (first one, then the other or both at the same time) (I remembered these from a similar setting in Word -- not the same keystrokes I don't think)

Member Avatar for Excizted
0
88
Member Avatar for ahmed adri

You're unfortunately about 2 days too late for presents. Please take a look at this [url]http://www.daniweb.com/forums/announcement61-2.html[/url] . On the bright side it sounds like it could be kind of a neat project!

Member Avatar for jonsca
-4
70
Member Avatar for hattisaeed

One thing to consider: [code] else { node*temp=top; } //where is temp at this point? nowhere it's been destroyed [/code] Small(er) stuff: It should be #include <iostream> and #include <string> (the latter of which you don't really use in your program). You need [iCODE]using namespace std;[/iCODE] (or better yet [iCODE]using …

Member Avatar for jonsca
0
90
Member Avatar for shishio1014

Just to clarify, are you reading your data into the program or is the user typing it in? However, in reality your struct should be the same either way you do it. OL# can be a string member of your struct, or you could make it an int member and …

Member Avatar for jonsca
0
137
Member Avatar for samsons17

Clear clears the failbit (a flag (bit) that was set to true when your used typed in a letter for your id instead of a number). cin.fail() is what checks the bits to see if the failbit has been set and returns true if it was. At that time that …

Member Avatar for jonsca
0
394
Member Avatar for cthoes

Where does words[] come into play? I see you declare it at the beginning and you try to display it at the end but it's no where in the middle... Also, why is name 20 chars and temp 10 chars? What happens if you try to copy a long name …

Member Avatar for jonsca
0
148

The End.