1,177 Posted Topics

Member Avatar for Rishabh876

You should post the code either directly on DaniWeb (using code tags) or on something like [url]http://codepad.org/[/url] . And your teacher was right - you shouldn't use goto :) David

Member Avatar for daviddoria
0
168
Member Avatar for beejay321

Put them into an std::vector of std::string's and then std::sort() them: [url]http://programmingexamples.net/index.php?title=CPP/AlphebetizeString[/url]

Member Avatar for peter_budo
0
2K
Member Avatar for daviddoria

[QUOTE]Ov course you don't, but many people here feel that vectors are the only solution to using arrays. They love suggesting things obviously beyond your level.[/QUOTE] This is not beyond his level. There is no reason to learn arrays before vectors. Novices should learn vectors because they convey the same …

Member Avatar for vijayan121
0
83
Member Avatar for kylemurray123
Re: c++

You should look into the Qt library. Poke around for some tutorials. I also have some examples here: [url]http://programmingexamples.net/index.php?title=Qt[/url] and a "crash course" here: [url]http://rpi.edu/~doriad/Talks/Qt_Introduction.pptx[/url] David

Member Avatar for Ancient Dragon
0
136
Member Avatar for jfunchio
Member Avatar for angelshonu11

Welcome to DaniWeb! We are all about learning here. No one really benefits if we just write code for you. What you should do is: 1) remove punctuation: [url]http://programmingexamples.net/index.php?title=CPP/Strings/DetectPunctuationparse[/url] 2) parse the file on ' ' : [url]http://programmingexamples.net/index.php?title=CPP/Strings/Split[/url] 3) put all of the words in a std::set and keep track …

Member Avatar for Moschops
-4
95
Member Avatar for ViXXeY

Welcome DaniWeb! A few suggestions: 1) Use code tags when posting code. It makes the code much easier for us to read. 2) Use real English words. I.e. "Please" instead of "Plz". It helps the community maintain a professional image. 3) You are outputting 'str' before assigning anything to it. …

Member Avatar for daviddoria
0
118
Member Avatar for Games53
Re: Help

You can do some cool tricks with stringstream: [url]http://programmingexamples.net/index.php?title=CPP/HexToInt[/url]

Member Avatar for Red Goose
0
89
Member Avatar for Nandomo

Are you opposed to using a library? ImageMagick, ITK, VTK, VIL (from VXL), CImg, and OpenCV should all do the trick :)

Member Avatar for Moschops
0
129
Member Avatar for megaLU

The type before the function name is the return type: [code] std::vector<long double> yourFunction() { vector<long double> a; return a; } [/code]

Member Avatar for megaLU
0
2K
Member Avatar for marufsiddiqui

sunny - please use code tags. loyd - no one is going to do your exam for you. Also, please don't "hijack" threads - that is, if your comment isn't directly useful for the original poster, you should start a new thread instead of replying to this one. David

Member Avatar for idriz12
0
2K
Member Avatar for leecheneler

I suggest hard coding a very small input, solving it by hand, then putting some output statements in your loop so you can see where what your programming is computing differs from your correct hand-computed solution.

Member Avatar for LTouch
0
2K
Member Avatar for Spartan_MSU12

Ok, you have multiple problems. 1) Those are not .o files. They are .cpp files. 2) At line 87 in diamond.cpp, you have [code] for (y = 1; y <= size - x; y++) { cout << " "; } cout << border; } [/code] That is an extra }, …

Member Avatar for daviddoria
0
129
Member Avatar for BanKuZ

Hi BanKuZ, welcome to DaniWeb! Which operator would you like to use? Maybe you can also post your class structure, I'm not sure I followed what is going on from what you posted. David

Member Avatar for BanKuZ
0
258
Member Avatar for valeriy_zf

I couldn't get this to completely work right now, but here is what I came up with when I tried to do it a while back. It certainly needs some cleaning! [code] // need to // export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/octave-3.2.4 // export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/octave-3.2.4 #include <octave/octave.h> #include <octave/oct.h> #include <octave/parse.h> #include <iostream> void …

Member Avatar for Manlin86
0
3K
Member Avatar for daviddoria

There are lots of stand alone programs (sqlitespy, sqlitestudio, etc) that give you nice spread-sheet style access to tables: [url]http://www.yunqa.de/delphi/lib/exe/detail.php/products/sqlitespy/sqlitespy.png?id=products:sqlitespy:index&DokuWiki=2oa8egb90q7fck3t3q2uk9nv61[/url] but does anyone know of a web based way to do this? Thanks, David

Member Avatar for drjohn
0
130
Member Avatar for ITHope

What do you mean "How do I use c++ to do ..." - it is a language - once you know what you want to do, you have to figure out how to do it within the language. You'd probably want to have a CoffeeMachine class that has functions like …

Member Avatar for daviddoria
0
178
Member Avatar for megaLU

Welcome to DaniWeb! You could do two things. 1) Make a struct, fill the struct with the two values, and return it. 2) "Return" a and b by reference. Also, please use code tags when posting code. Good luck, David

Member Avatar for megaLU
0
154
Member Avatar for simply_viks

What is ACE? I suggest you ask the ACE people how to do this, as it is not standard c++. Here is an example how concatenating STL strings: [url]http://programmingexamples.net/index.php?title=CPP/Strings/Concatenate[/url]

Member Avatar for hvalola
0
88
Member Avatar for dennis.d.elston

What are all of those cutoff* variables? Why wouldn't you just assign the calculations to 'tax' as was done originally?

Member Avatar for dennis.d.elston
0
193
Member Avatar for mIXpRo

Please also provide sorted_list_example.cpp. However, both files should not need to be longer than about 15 lines to demonstrate the problem :)

Member Avatar for mIXpRo
0
192
Member Avatar for daviddoria

I finally got my navigation drop down menu working! [url]http://ewh.ieee.org/r1/schenectady/[/url] I had been testing in Chrome, Firefox, and IE8. Before my celebration even really started, a user pointed out (correctly) that it doesn't work in IE7 :( The menus drop down on hover, but they aren't aligned, and you can't …

Member Avatar for maryparker
0
181
Member Avatar for gyagyus
Member Avatar for mangopearapples

You will not find the source of a linker error anywhere in the code. It means you are not linking to the opengl libraries properly. Please send the actual error output. It would also help if you could make and send us the shortest program that you can that gives …

Member Avatar for mangopearapples
0
138
Member Avatar for daviddoria

On this page: [url]http://ewh.ieee.org/r1/schenectady/New/[/url] it seems like the gray background object is larger than the screen - i.e. scroll bars appear even though the content is not long enough to warrant them. I have the following properties: [code] body { height: 100%; } html { height: 100%; } [/code] Shouldn't …

Member Avatar for Arkinder
0
114
Member Avatar for daviddoria

On this page: [url]http://ewh.ieee.org/r1/schenectady/New/[/url] I have two elements, "bluegradient" and "whitebox". The bluegradient height is 80% (of the page, right?). The whitebox height is 80% (I think this "80% of the height of the bluegradient" since it is nested, right?). The whitebox has top and bottom margins of 10% (this …

Member Avatar for daviddoria
0
850
Member Avatar for daviddoria

On this page: [url]http://ewh.ieee.org/r1/schenectady/New/[/url] I have the title image and title text: [code] <center> <a href="index.php"><img style="vertical-align:middle;" src="/r1/schenectady/images/IEEE.gif"></a> <span id="lightblue" style="vertical-align:middle; font-size: 40pt;" >Schenectady Section</span> </center> [/code] then a paragraph break: [code] <p/> [/code] then a row of drop down lists, then another [icode]<p/>[/icode] then some text. The problem is …

Member Avatar for daviddoria
0
7K
Member Avatar for BigDeveloper

I suggest you make a small compilable example. What is the problem? Compiler errors? Crash? Incorrect result?

Member Avatar for BigDeveloper
0
147
Member Avatar for johans22

What are you trying to do? I'll assume simply run something in another thread? You could use boost threads: [url]http://programmingexamples.net/index.php?title=CPP/Boost/Threads[/url] or Qt threads: [url]http://programmingexamples.net/index.php?title=Qt/Widgets/Thread[/url]

Member Avatar for daviddoria
0
85
Member Avatar for rabihayass

Please use code tags when you post code. Also, this doesn't really sound like a c++ question - maybe you should post here: [url]http://www.daniweb.com/forums/forum71.html[/url]

Member Avatar for daviddoria
0
182
Member Avatar for daviddoria

This is my page with only the header row of the table: [url]http://ewh.ieee.org/r1/schenectady/New/test2.html[/url] When I start adding rows, everything looks good, until I add row 13. Here is an example: [url]http://ewh.ieee.org/r1/schenectady/New/test.html[/url] You can see the header (the grey box) "wiggles" just a little bit. I thought there may have been …

Member Avatar for daviddoria
0
84
Member Avatar for viandante

You could email the guys in charge: [url]http://sqliteman.com/page/7.html[/url] and tell them you are interested in writing this and see if they can point you in the right direction. Sometimes they will give you the best free tutorial you can imagine, sometimes they will yell at you and tell you go …

Member Avatar for viandante
0
126
Member Avatar for daviddoria

I have a drop down box like this: [code] <select name="DateDropDown"> <option value="2010 selected">2010</option> <option value="2009">2009</option> <option value="2008">2008</option> </select> [/code] I use the value that the user selects to refresh the page and perform a query on a database. Is there a better way than the following to keep the …

Member Avatar for daviddoria
0
7K
Member Avatar for daviddoria

I have a database, test.db, with a table called Events. I tried this: [code] <?php try { // open the database $database = new PDO('sqlite:test.db'); $result = $db->query('SELECT * FROM Events'); foreach($result as $row) { // both of these lines produce a blank page //echo $row['EventName'] . ' | ' …

Member Avatar for daviddoria
0
108
Member Avatar for pie555

ImageMagick has a c++ API: [url]http://www.imagemagick.org/script/index.php[/url] that could certainly do this. Otherwise, libjpeg sounds like a reasonable choice: [url]http://www.ijg.org/[/url] though I've never used it. David

Member Avatar for pie555
0
2K
Member Avatar for daviddoria

Hi all, I am transitioning a bunch of data from html (yuck!) to some sort of separated schema. I was going to use xml: [code] <events> <event> <title> <date> <speaker> <description> </event> </events> [/code] but now I am wondering if I should use a real database instead. Can anyone comment …

Member Avatar for d5e5
0
113
Member Avatar for daviddoria

Please excuse my newness. Currently I know how to execute a php script by simply naming the script [filename].php and browsing to that file on my webserver. I have also learned how to parse and display an xml file using php. What I want to do is have a .xml …

Member Avatar for P0lT10n
0
1K
Member Avatar for daviddoria

I want to have files like this: File1.xml [code] <titletag> Title1 goes here </titletag> <contenttag> Content1 goes here </contenttag> [/code] and then use this data with something like: [code] <html> <body> ... Place <contents of titletag from File1.xml> here </html> [/code] Is this a reasonable request? How would I do …

Member Avatar for Kraai
0
121
Member Avatar for harryhaaren

Check out the insert() and copy() function. There are examples here: [url]http://programmingexamples.net/index.php?title=CPP/STL/Vector[/url] David

Member Avatar for Narue
0
4K
Member Avatar for effizy

I would suggest you go to sourceforge.net or github.com and search around for something that interests you. Many of these projects are small so people may be excited to receive help.

Member Avatar for daviddoria
0
259
Member Avatar for chamika.deshan
Member Avatar for chamika.deshan
0
108
Member Avatar for modjoe

So what is the problem? Are there compiler errors? Does it crash? Do you get the wrong result? I suggest hard coding a simple input that you can compute the entire algorithm by hand. Then you can check your programs state every step of the way.

Member Avatar for daviddoria
0
510
Member Avatar for CrazyPixel
Member Avatar for jonsca
0
171
Member Avatar for rgutierrez1014

You should step through the code with a debugger and determine exactly which line the segfault happens on. This will give you (and us) a better starting point.

Member Avatar for gerard4143
0
191
Member Avatar for MylesDBaker

MylesDBaker, Is this for a course (where they have made you write your own graph class, etc)? Or because you actually need to use a maxflow algorithm? If it is the later, I would like to suggest that you use an existing graph library (I use vtkGraph from VTK (vtk.org) …

Member Avatar for daviddoria
0
232
Member Avatar for ravindasenarath

I think you'll have better luck asking the OpenCV people: [url]http://tech.groups.yahoo.com/group/OpenCV/[/url]

Member Avatar for daviddoria
0
151
Member Avatar for Lando_

You have posted everything except the findLowest function! What have you tried? I bet it should involve some conditionals (ifs) and some < operations.

Member Avatar for WaltP
0
119
Member Avatar for DevonParsons

I strongly suggest Qt. The crossplatform-ness is a HUGE plus in today's very varied operating system landscape. There are some examples here: [url]http://programmingexamples.net/index.php?title=Qt[/url] And the Qt documentation itself is very good: [url]http://doc.qt.nokia.com/latest/classes.html[/url]

Member Avatar for daviddoria
0
164
Member Avatar for steve_Student

Please try to pose your question in a way that can be demonstrated in < 20 lines of code and is generally usable for other readers.

Member Avatar for daviddoria
0
245
Member Avatar for mohd22

Here is an example: [url]http://programmingexamples.net/index.php?title=CPP/RandomNumbers[/url] What is the error you're getting?

Member Avatar for alexchen
0
216

The End.