2,045 Posted Topics

Member Avatar for sdgz747

[icode]while (n >= 1 && n <= 30) [/icode] since the while loop runs while it's true you want it to cut out when either one of these is false. It's a bit counterintuitive at first. To solve your other problem, I believe you need [code] float n = 0f; …

Member Avatar for sdgz747
0
119
Member Avatar for whoamineo89

You have not made an instance of your struct like: [code] struct addressbook { char name [NAME] ; char address [ADDRESS]; char phone [PHONE]; char email [EMAIL] ; char Target[NAME]; } addresses; [/code] In fact you probably want an array of them so #define the number of addresses (say NUMAD) …

Member Avatar for Ancient Dragon
1
5K
Member Avatar for nuB

What are the specific errors that you got (the first 5-10 are good for now). Also, I see you tried on the code tags but it has to be [noparse] [code] //code here [/code] [/noparse]

Member Avatar for nuB
0
189
Member Avatar for ravenrider

At what point do you get the seg fault? One hint is that your filename is not making it into your readin function at all. You've appeased the compiler by redeclaring it but there's nothing in it. I suspect there are other areas as well. If you're going to use …

Member Avatar for Salem
0
128
Member Avatar for stevebtn

Would it be possible for you to use an array called W and fill in the elements 12, 13, 14, etc. I understand what you are trying to do but I do not believe C has an "eval" type command that can assign variable names at runtime. How would you …

Member Avatar for WaltP
0
101
Member Avatar for Asalearam

[quote]Give me a tutorial [/quote] This is very demanding and bordering on rude. Despite that I (more than wholeheartedly) agree with WaltP's sentiment I still wanted to plug a book that I really liked which was [URL="http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip"]this[/URL]. It's also legitimately free which is nice.

Member Avatar for Stefano Mtangoo
0
541
Member Avatar for juniorSkillz

MaxLength is the constant that you should compare against. I think the comparison would be textBox1.TextLength > textBox1.MaxLength, but I tried it a few times and it looks like you don't need to do anything because once you're at the MaxLength it won't let you add anything more into the …

Member Avatar for Geekitygeek
0
1K
Member Avatar for DrueY

Learn just a smidgen about wavelet transformations. Those are used in image processing and denoising methods of all kinds. Next time, though, try to search more extensively on the net because you couldn't possibly have missed something like numerical integration.

Member Avatar for jonsca
0
100
Member Avatar for cyfuzhi

Unless I misread what you need I think you are complicating things a bit more than needed. Try something like the following (I'll let you flesh it out): [code] for (int i = 0;p_cString[i] !='\0';i++) if(p_cString[i] == valueToFind) { [/code] Since you know the length of your string you could …

Member Avatar for jonsca
0
72
Member Avatar for alma27534

[quote]Yea but this is for Visual Studio 2003 and I'm using 2008.[/quote] It's identical, I just checked it to make sure. Mine just says "Properties" on the project menu but I've seen it say "MyProjectName" Properties at points. Click on configuration properties on the sidebar of that window to get …

Member Avatar for alma27534
0
303
Member Avatar for maria1110

Firstly, presentation is paramount. Please wrap your code in code tags. Use the edit button to edit your post. [noparse] [code] /*code goes here */ [/code] [/noparse] You may be frantic but there's no need to panic, this is a solvable problem. I haven't run your program yet but there …

Member Avatar for WaltP
0
132
Member Avatar for lloydi12345

Welcome to floating point. :) You'll find that small errors here and there can propagate very quickly. First try a much better approximation for pi and see how it changes things. It may buy you a little bit. Also, going from floats to doubles probably doesn't buy you much and …

Member Avatar for WaltP
0
129
Member Avatar for COKEDUDE

What DS means is don't try to return a value, just have a [icode] return; [/icode] statement where you need it. If is not a loop anyhow. What is the specific warning you are getting?

Member Avatar for abhimanipal
0
145
Member Avatar for delhiris

[quote] What is this->Controls->Add(color);? What will happen if code below is without this->Controls->Add(color);? What is the result from the code this->Controls->Add(color);? [/quote] This statement actually adds the button you have created to the set of controls(buttons, listboxes, etc) that are associate with your window. Without it you won't have access …

Member Avatar for jonsca
0
80
Member Avatar for ROTC89

All you've done there is put the names into a string array. I think what you mean is if you had the class Rectangle, you could create an array of rectangles by saying [code] Rectangle [] rects = new Rectangle[5]; rects[0] = new Rectangle(10,10,1,1); rects[1] = new Rectangle(5,5,1,1); etc. [/code] …

Member Avatar for ROTC89
0
88
Member Avatar for jonyb222

[quote]I have a few other subclasses of Event and they aren't giving me any trouble.[/quote] How are their class declarations different from this one? I don't see anything in this one that's incorrect.

Member Avatar for jonyb222
0
558
Member Avatar for greatunknown

Is it a 2D vector or is there another vector at each of the positions(like a 3D)? Perhaps a small piece of the code would be helpful.

Member Avatar for greatunknown
0
82
Member Avatar for donelliewhyte

Depending on the layout of the file you should be able to use fgets to get the string and then use strcmp to compare it. If this is a direct continuation from your other thread's question you should ask a moderator to close this one and merge it with the …

Member Avatar for Nick Evan
0
73
Member Avatar for programer411

Are you allowed to use a vector? If so you just pass in the vector and you'll have the count and you can find the max in the bucketSort function itself. Even if you can't use the vector (noting your use of printf might lead me to believe that you …

Member Avatar for programer411
0
151
Member Avatar for kavithabhaskar

[quote]but what I have here completely makes sense..[/quote] To you maybe, but it doesn't work for the compiler. The other poster was correct.

Member Avatar for kavithabhaskar
0
94
Member Avatar for sexyzebra19

[icode]myfile << data_[i+ndim_*j] << " "; [/icode] should be [icode]myfile << data_[i+mdim_*j] << " "; [/icode] Since you are jumping by a count of the number of rows each time you span a column. Do a quick "desk check" of it with pencil and paper to see.

Member Avatar for sexyzebra19
0
102
Member Avatar for lionaneesh

[U]Thread closed[/U] means no one can post on it anymore, it doesn't say anything about the forum. Aia just wanted you to read the information that was there. You haven't done any irreparable damage (at least not in my book) but it considered quite rude to "bump" your thread up …

Member Avatar for jonsca
0
169
Member Avatar for HBK_100
Member Avatar for jonsca
0
110
Member Avatar for jonsca

Since mid-afternoon the text in the C forum has been showing up centered on the page (thread listings, threads). I'm using Firefox 3.58. I just checked on IE 8 and it looks ok except that the Intel banner ad is in the wrong place. Anyway, just thought I would let …

Member Avatar for jonsca
0
182
Member Avatar for digiguy

Move the endl in the for loops outside of the first one so it's only called once per row. Also, you don't verify that your input fulfills those criteria you just print it out. See [URL="http://www.daniweb.com/forums/post1021268.html#post1021268"]this thread[/URL] to get some idea of what's involved. If that's a lot, simply test …

Member Avatar for digiguy
0
95
Member Avatar for sexyzebra19

Matrices in C/C++ are laid out rowwise (versus columnwise like you are doing,used in FORTRAN and probably others, I think) first one row, then the next, etc. So expanding your first matrix would look like 1 2 3 4 5 6. There's no need for rearranging. Here's a [URL="http://fredosaurus.com/notes-cpp/arrayptr/23two-dim-array-memory-layout.html"]nice diagram[/URL].

Member Avatar for sexyzebra19
0
95
Member Avatar for kangarooblood

A few things: <iostream.h> and <string.h> have long been standardized to <iostream> and <string>. Also, try to avoid goto if at all humanly possible. Look into a do/while loop for a cleaner way of doing what you did there. Rather than going through a system like you have there consider …

Member Avatar for jonsca
0
173
Member Avatar for foco

[code] ofstream myfile (filename.[COLOR="Green"]c_str()[/COLOR]); [/code] Gives you a C style string that the method wants (with a '\0' (null) terminus).

Member Avatar for WaltP
0
105
Member Avatar for bogenbroom
Member Avatar for bogenbroom
0
1K
Member Avatar for aallan

There are two options, neither of which will be a quick learn unfortunately (certainly that depends on the amount of time you are willing to put into it). The express edition offers you two options for doing GUI. The first is Win32 API which is quite powerful but can also …

Member Avatar for Stefano Mtangoo
0
437
Member Avatar for Stefano Mtangoo

[URL="http://dinosaur.compilertools.net/lex/index.html"]This [/URL]goes very much in depth but seems to have some good background in the beginning. Lex is a specific lexer but the concepts are the same.

Member Avatar for Stefano Mtangoo
0
85
Member Avatar for konata_89

The first question to ask is where do function prototypes belong? Not in main(). After that you should compare the prototype for the function list with the definition of it down below. They don't match. After that it's some minor adjustments once you decide whether you're passing the pointer or …

Member Avatar for konata_89
0
129
Member Avatar for yznk

street is not declared as an array. However, even if you were to declare it as such, you must declare the rows and columns at compile time. Some compilers may allow you to declare street on line 33 (technically after the time when row and column should have values) but …

Member Avatar for jonsca
0
110
Member Avatar for jamesbraders
Member Avatar for Chichiro

[quote]So , is it means that software engineering will include programming ? [/quote] More than likely but like Salem said Software Engineering is going to teach programming as a means to an end and may teach important concepts independent of language. The overall picture will probably be more theoretical. That …

Member Avatar for Chichiro
0
387
Member Avatar for wolfkrug

Hitting enter finishes the copying process. Put something like cin.get() at the end of your code to get a pause effect so that you'll have more time.

Member Avatar for wolfkrug
0
108
Member Avatar for kohkohkoh

Use the button.PerformClick() method (fill in the name of your control for button).

Member Avatar for kohkohkoh
0
90
Member Avatar for mmgoicochea

There is nothing in first second or third when you are calling your method. Where should these values come from? I think you mean to pass them by reference, so add a & before each variable name in your prototype and function definitions (but not where you call it) For …

Member Avatar for mmgoicochea
0
166
Member Avatar for BobbieJean

[icode] char EmpName;[/icode] Char holds exactly that: 1 char. Make it into a string.

Member Avatar for BobbieJean
0
2K
Member Avatar for adamjw3

You would need to make this a static member of a class to use it but the basic gist of it is like [code] string Formatstring(string input,int length,string suffix) { return (input.Substring(0,length)+suffix); } [/code]

Member Avatar for apegram
0
1K
Member Avatar for dinamit875

I believe it's a non-standard BGI function from Borland's library. It's probably not going to be included with the Dev-C++ gcc.

Member Avatar for dinamit875
0
356
Member Avatar for Encrypted

cost isn't initialized in that function. If you get to the else section of the if clauses then you won't assign cost and you will return garbage.

Member Avatar for Dave Sinkula
0
137
Member Avatar for webdragon89

@tetron Some additional material for this thread can be found [URL="http://www.daniweb.com/forums/thread262159.html"]here[/URL] as well

Member Avatar for tetron
0
401
Member Avatar for PDB1982

Hotdogstand is your class, so it's a type. It's not int Hotdogstand[] it's gotta be of type Hotdogstand[]. [code] void HotDogStand::JustSold(int DogCounter, int numCarts, int HotDogStand[]) should be void HotDogStand::JustSold(int DogCounter, int numCarts, HotDogStand CartSales[]) [/code] and you have to pass in CartSales (no brackets) when you call the method …

Member Avatar for PDB1982
0
114
Member Avatar for callister

Your algorithm is missing a piece I think it should be [code] if (f(x)*f(a) <0) //sign change between a and x, dump right half b=x; else if(f(x)*f(b)<0) //sign change between b and x dump left a=x; else //no change no root break;//we got it [/code] That being said, I only …

Member Avatar for callister
0
223
Member Avatar for riotburn

Use some of the methods from iomanip ([URL="http://www.cplusplus.com/reference/iostream/manipulators/"]#include <iomanip>[/URL]). Pay particular attention to "fixed" and "setprecision," they'll give you what you need.

Member Avatar for jazz_vill
0
420
Member Avatar for exeric90

i never changes within your while loop on line 25, so you're always stuck at 0 < 1 and it loops forever.

Member Avatar for jonsca
0
145
Member Avatar for anthony5557

In Solution Explorer right click on your project name (in bold print), go to Add.. /New Item and select header file. If Solution Explorer is not visible go to View/Solution Explorer. [quote]Visual Basic C++ 2008. [/quote] We went over this already that is not the name of it. You either …

Member Avatar for anthony5557
0
92
Member Avatar for techie929

See [URL="http://msdn.microsoft.com/en-us/library/bb773454%28VS.85%29.aspx"]this[/URL] at MSDN. Aside from their void main(argh) you can probably adopt the example they have there (you can leave the TCHAR in as it resolves to the type of the character set under which you are compiling, e.g. char for ASCII). Just make a string of all the …

Member Avatar for jonsca
0
96
Member Avatar for valeriy_zf

The best way in your case (with the .NET) is to create 2 timer objects, one for the "background" animation and one to pace the foreground changes. You can have two methods, one in each of the timers (one for drawing the foreground elements and one for the background) that …

Member Avatar for valeriy_zf
0
147

The End.