Forum: C++ Jul 14th, 2006 |
| Replies: 16 Views: 22,507 In that case, you need to ease off on your project and do something closer to your current skill level. If you can't figure out how to use such a simple class, you're not even close to being ready to... |
Forum: C++ Jul 14th, 2006 |
| Replies: 16 Views: 22,507 >> can u give send me some code how to seperate the contents from commas.
That nice convenient class I posted that does exactly what you asked for must not have been what you really wanted. Why are... |
Forum: C++ Jul 14th, 2006 |
| Replies: 3 Views: 2,222 It's just what the error says. You can't have that particular debugging switch active when optimizing for speed. Under your project settings, the general tab in C/C++, you can change Debug... |
Forum: C++ Jul 14th, 2006 |
| Replies: 16 Views: 22,507 >> Extent of CSV format is like
Well that's simple enough. You don't need to do any tricky parsing if there won't be commas embedded in a field.
#include <sstream>
#include <string>
#include... |
Forum: C++ Jul 14th, 2006 |
| Replies: 16 Views: 22,507 What's the extent of your CSV format? Is it just a bunch of fields separated by commas, or can the fields contain commas as well? A full CSV format means you need to do some tricky quotation parsing... |
Forum: C++ Jun 28th, 2005 |
| Replies: 2 Views: 2,482 > Please some one write this program
No. If you're too lazy to do it then you deserve a failing grade. |
Forum: C++ Jun 25th, 2005 |
| Replies: 20 Views: 6,710 > How very true, but STL is chapter 10. I'm at chapter 6
What are you talking about? The STL has nothing to do with redirecting the output of a program to a file from the shell. If you were talking... |
Forum: C++ Jun 25th, 2005 |
| Replies: 20 Views: 6,710 > Would it be something like this then?
Something like that, yea. But wouldn't it be faster to try it out for yourself? ;)
> Also, do I need to use forward or backward slashes?
Either will work... |
Forum: C++ Jun 25th, 2005 |
| Replies: 20 Views: 6,710 > Do I have to enter the same path wich it has to follow as in the other ones?
Yes. For simplicity, my example assumed that both the executable program and the file were local to the root directory... |
Forum: C++ Jun 23rd, 2005 |
| Replies: 20 Views: 6,710 > In other words, it means that *pp has those properties wich are mentioned in the structure right
Yea, basically.
> And can only a pointer have that ability to be written in that place
No,... |
Forum: C++ Jun 22nd, 2005 |
| Replies: 6 Views: 2,690 Hey, the code is correct, so you're ahead of most of the tutorials on the web these days. ;)
Your site is bookmarked. I'll consider joining. |
Forum: C++ Jun 22nd, 2005 |
| Replies: 6 Views: 2,690 > First of all, open your C++ compiler.
This assumes that you're using an IDE and not a command line based compiler. For the latter you would open a text editor, and the compiler wouldn't be invoked... |
Forum: C++ Jun 22nd, 2005 |
| Replies: 1 Views: 5,332 You're thinking too hard. :)
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
int main()
{
const char InputFileName[] ="in.txt"; |
Forum: C++ Jun 22nd, 2005 |
| Replies: 3 Views: 7,358 > Can you please provide me with examples of when and how copy constructors are used..
The simplest example is passing an object by value:
class C {};
void foo(C obj); // C's copy constructor... |
Forum: C++ Jun 21st, 2005 |
| Replies: 20 Views: 6,710 1) No, a structure's members are public by default, so anyone can access them. Dave put the structure in main to limit its scope to main. Consider this:
int main()
{
struct test {};
test t;... |
Forum: C++ Jun 19th, 2005 |
| Replies: 1 Views: 1,995 > and I dont have a complier
I suggest you get one, because your code will not compile. Or at the very least, you can test drive Comeau here (http://www.comeaucomputing.com/tryitout/) to see what... |
Forum: C++ Jun 19th, 2005 |
| Replies: 3 Views: 4,726 Dude, this thread is well over a year old. Next time, if you have a new question, start a new thread.
To save an array to file, just open the file, then loop over the array and write each element... |
Forum: C++ Jun 18th, 2005 |
| Replies: 4 Views: 3,150 > I did this because The code was to long DUDE is two files
That's where you make it smaller so that it's suitable for posting. You know, cut out all of the fluff so that just the necessary stuff... |
Forum: C++ Jun 18th, 2005 |
| Replies: 4 Views: 3,150 It's best to assume that we're all overly paranoid. I'm not going to download anything from your site unless you can prove to me that it's completely harmless. The best way to do that is to post code... |
Forum: C++ Jun 16th, 2005 |
| Replies: 3 Views: 4,595 > Containment is the same as composition?
Yes.
> can I create an instance of one class within or from another?
Of course.
> Can I modify a previusly constructed object?
As long as it isn't... |
Forum: C++ Jun 16th, 2005 |
| Replies: 8 Views: 2,991 In that situation, you make the operator inline. The correct way to define it outside of your class is way too awkward to be practical:
#include <iostream>
using namespace std;
template... |
Forum: C++ Jun 16th, 2005 |
| Replies: 3 Views: 4,595 > I have no idea what I'm doing.
Clearly. You have serious design problems by using inheritance instead of containment for this project. It's much simpler if CartesianPoint (aside from being more... |
Forum: C++ Jun 16th, 2005 |
| Replies: 8 Views: 2,991 operator<< doesn't need to be a friend since you only use the public interface of array in it. A non-member function only needs to be a friend if it has to have access to a classes private or... |
Forum: C++ Jun 13th, 2005 |
| Replies: 4 Views: 3,321 > the question is why not doing this using C ?
Because C doesn't provide native support for crawling the web, and there aren't any commonly used libraries for it. In the time you would take to find... |
Forum: C++ Jun 12th, 2005 |
| Replies: 4 Views: 3,321 I don't think this is the right forum for your question, unless you plan on writing this program in C or C++. |
Forum: C++ Jun 12th, 2005 |
| Replies: 5 Views: 1,706 Okay, what do you have so far? |
Forum: C++ Jun 9th, 2005 |
| Replies: 11 Views: 2,556 That's because it's not allowed there. :rolleyes: Using static to qualify functions is deprecated anyway, use an unnamed namespace instead:
namespace {
template <> double ToDouble( double... |
Forum: C++ Jun 9th, 2005 |
| Replies: 11 Views: 2,556 template <> double ToDouble( double source )
{
return source;
} |
Forum: C++ Jun 7th, 2005 |
| Replies: 2 Views: 5,044 >> (certainly not C or C++).
It looks like Managed C++. But I agree that this question would be better asked in a .NET forum. |
Forum: C++ Jun 7th, 2005 |
| Replies: 6 Views: 18,116 You need to include <iomanip> for setprecision(). |
Forum: C++ Jun 6th, 2005 |
| Replies: 7 Views: 3,231 This is a classic trade-off, and unfortunately, one that only you can decide. |
Forum: C++ Jun 6th, 2005 |
| Replies: 3 Views: 1,541 Anytime you need to split off into one or more separate paths, you're looking at a switch or if chain. |
Forum: C++ Jun 6th, 2005 |
| Replies: 6 Views: 6,862 >> is <fstream.h> different than <fstream>?
Yes, very different. <fstream> is a standard modification of the prestandard <fstream.h>, where all of the classes are turned into template classes and a... |
Forum: C++ Jun 6th, 2005 |
| Replies: 6 Views: 6,862 >> #include <fstream.h>
Mixing old and new headers will bite you every time.
#include <fstream>
using std::ifstream;
That's why it's a good idea to cut and paste the code you have from the... |
Forum: C++ Jun 6th, 2005 |
| Replies: 3 Views: 2,982 >> Here is the compile log from Dev-C++:
That's assuming that Zackery doesn't have Allegro installed, which he probably does. Almost all of those errors and warnings have to do with you not... |
Forum: C++ Jun 6th, 2005 |
| Replies: 3 Views: 1,541 >> Are they the same?
Kinda sorta, but not really. A switch is a control flow structure that directs execution through a certain block of code depending on an integral value. In other words, it's... |
Forum: C++ Jun 6th, 2005 |
| Replies: 7 Views: 3,231 Why even bother? A hash_map has better performance properties, so it makes sense to choose it over a map. If the user needs something sorted, they can list to a stringstream, then to a vector, then... |
Forum: C++ Jun 6th, 2005 |
| Replies: 7 Views: 3,231 >> I was hoping to not force the user to know that I was using map or hash_map
That's dangerous since the operations of a map and typical hash_map implementations are wildly different. If you're... |
Forum: C++ Jun 6th, 2005 |
| Replies: 3 Views: 2,072 Is that the exact error or your rendition of the error? |
Forum: C++ Jun 6th, 2005 |
| Replies: 6 Views: 6,862 >> ccin.open(data.dat);
I think you mean
ccin.open("data.dat");
>> getline(ccin,str);//the problem :(
Looks okay to me. What compiler are you using? Can you give us a short and complete... |