Forum: C++ Mar 23rd, 2007 |
| Replies: 14 Views: 3,161 Re: system("pause"); Right, it is part of the current standard, but such C functions might be removed in the future (and a new standard is due out in the next couple years) |
Forum: C++ Mar 23rd, 2007 |
| Replies: 14 Views: 3,161 Re: system("pause"); According to the standard, the c header files are deprecated, meaning they might be removed from the standard in future revisions. |
Forum: C Nov 22nd, 2006 |
| Replies: 15 Views: 2,492 Re: copy constructor and 2 args constructor help Entry *entry;
entry = new Entry(media, entertainment);
What are you trying to do here? You've already assigned the private members of the class (_media and _entertainment). And once the function... |
Forum: C++ Oct 20th, 2006 |
| Replies: 6 Views: 1,143 Re: operator() In addition, you may want to search for "functor" or "function object" for more information. |
Forum: C++ Oct 15th, 2006 |
| Replies: 13 Views: 2,390 Re: Weird Stuff about Dev-C++ Compiler It's not an "abnormality," it's actually part of the C++ standard. As I understand it, operators like 'and' and 'or' are included for users with different character sets. See:... |
Forum: C++ Oct 12th, 2006 |
| Replies: 3 Views: 1,976 |
Forum: C++ Oct 9th, 2006 |
| Replies: 8 Views: 4,086 |
Forum: C++ Oct 9th, 2006 |
| Replies: 7 Views: 3,252 Re: Writing text from textbox to file... Since it appears you are using managed (.NET) code, why not use the .NET classes for file IO? I'm no expert at C++/CLI but it might be as simple as:
System::IO::StreamWriter^ sw = gcnew... |
Forum: C++ Oct 7th, 2006 |
| Replies: 3 Views: 2,014 Re: iterator based search algorithm help If you're going to use std::find like that, you need to define an equality operator for your info class:
class Info
{
public:
bool operator==(const std::string& first_name);
//...
}
However, you... |
Forum: C++ Oct 7th, 2006 |
| Replies: 6 Views: 2,795 Re: How does one tolower an entire string? Do you mean the length of a c-style string (char array) or the length of a std::string? You could use strlen for the former, and the length() member function for the latter |
Forum: C++ Oct 7th, 2006 |
| Replies: 4 Views: 1,676 |
Forum: C++ Oct 4th, 2006 |
| Replies: 7 Views: 1,131 Re: My Program Wont Work!! Help!!!!! Try indenting/using code tags (some IDEs can even indent for you!):
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
// Declare Variables
int... |
Forum: C++ Oct 3rd, 2006 |
| Replies: 19 Views: 2,515 Re: Need some help with n00b code project Think about it this way (ignore the total for now):
End of Month 1: Adults - 1, Babies - 0
End of Month 2: Adults - 1, Babies - 1
End of Month 3: Adults - 2, Babies - 1 <-- Number of adults _last_... |
Forum: C++ Oct 3rd, 2006 |
| Replies: 10 Views: 2,790 Re: Question about card game One of those little errors, it appears:
for ( int i = 0; i < 13; i++ ); //<--semicolon
See if that works when you remove the trailing semicolon.
As a side note, you should probably prefer passing... |
Forum: C++ Oct 2nd, 2006 |
| Replies: 10 Views: 2,790 Re: Question about card game hand appears to be a 2-dimensional array, in which case you need to compare each element (if you use only one subscript, you're comparing a pointer to an integer)
if (hand[i][0]==1 &&... |
Forum: C++ Oct 2nd, 2006 |
| Replies: 19 Views: 2,515 Re: Need some help with n00b code project First thing you probably want to do is write out more of that table (incidentally, I just recognized that sequence). Once you can describe the pattern, it shouldn't be too hard to replicate it.
... |
Forum: C++ Oct 2nd, 2006 |
| Replies: 2 Views: 2,270 Re: Binary Tree help Any particulary reason you're writing procedural code in C++? A better approach would be to create a tree class that handles everything.
Anyways, one major problem you have is that you pass a... |
Forum: C++ Oct 2nd, 2006 |
| Replies: 19 Views: 2,515 |
Forum: C++ Oct 1st, 2006 |
| Replies: 7 Views: 2,059 Re: strstream problem Your code shouldn't even compile. You're missing a using declaration (I assume) and main should return 'int'
Also, you should use std::stringstream instead of strstream (I believe the latter is... |
Forum: C++ Sep 29th, 2006 |
| Replies: 5 Views: 1,603 Re: static data member help I believe static variables will be automatically initialized to zero or with their default constructor (and someone correct me if I'm wrong) if you don't specify, so it shouldn't be necessary. It's... |
Forum: C++ Sep 23rd, 2006 |
| Replies: 8 Views: 8,066 Re: Working in Visual C++ to parse some text files Are you using microsoft's managed extensions for C++ (.NET in VS 2003)? You might want to consider using C++/CLI instead for .NET programming (you can download Visual C++ 2005 Express for free). Keep... |
Forum: C++ Sep 22nd, 2006 |
| Replies: 5 Views: 1,352 Re: nested for loops Looks like a decent start. You just need to find a way to get the correct subscript into 'deck' to assign values in the inner loop, and then figure out how to shuffle the deck. The simplest way to do... |
Forum: C++ Sep 18th, 2006 |
| Replies: 6 Views: 1,282 Re: Help with derived class and arithmetic in C++ How exactly are you linking this? I see you have two entry points (in pointTypeImp.cpp and circleTypeImp.cpp) and circleTypeImp.cpp relies on code from pointTypeImp.cpp. Obviously, though, you aren't... |
Forum: C Sep 18th, 2006 |
| Replies: 2 Views: 2,383 Re: Can't load bitmap resource into Image List Well, it seems likely the problem is in one of the two parameters you pass to the LoadBitmap function. You should check the return value of GetLastError after LoadBitmap fails, and look it up here... |
Forum: C++ Sep 15th, 2006 |
| Replies: 4 Views: 1,712 Re: (was) STL <map> question Maybe there's a problem with your compiler/IDE installation or with the header files.
Also, make sure your code is being compiled as C++ and not C |
Forum: C Sep 12th, 2006 |
| Replies: 2 Views: 959 |
Forum: C++ Sep 12th, 2006 |
| Replies: 8 Views: 8,066 |
Forum: C++ Sep 11th, 2006 |
| Replies: 4 Views: 1,121 |
Forum: C Sep 11th, 2006 |
| Replies: 1 Views: 1,132 |
Forum: C Sep 11th, 2006 |
| Replies: 5 Views: 1,525 Re: Calculating a control position on a window SendMessage(GetDlgItem(hwnd, IDC_STATUSBAR), SB_SETTEXT, 255, (LPARAM)(LPSTR)"Ready");
The WPARAM argument should be a zero-based index (with 255/SB_SIMPLEID it probably assumes the control is a... |
Forum: C++ Sep 10th, 2006 |
| Replies: 6 Views: 1,513 Re: Help! error LNK2001 & error LNK Well, just because I think it's good practice doesn't make it so. Sometimes people say that not specifying a return value for main is nonstandard, which it isn't.
Just nitpicking, really. |
Forum: C++ Sep 10th, 2006 |
| Replies: 6 Views: 1,513 Re: Help! error LNK2001 & error LNK > with a return 0 at the end of the program, as defined by the C++ Standard.
Actually, return 0 is implicit for main() if a return statement is omitted. It's probably still good practice to... |
Forum: C Sep 10th, 2006 |
| Replies: 5 Views: 1,525 |
Forum: C++ Sep 9th, 2006 |
| Replies: 5 Views: 1,253 Re: Met problems with my first win32 program Visual Studio? Try Linker->System->Subsystem (/SUBSYSTEM:WINDOWS)
Although I can't guarantee there aren't other options that are normally set for a Win32 project, and I don't know why you would... |
Forum: C++ Sep 9th, 2006 |
| Replies: 5 Views: 1,253 |
Forum: C++ Sep 7th, 2006 |
| Replies: 2 Views: 759 Re: on Ifstream open expects a c-style string. You can use the c_str() std::string member function:
InObj.open(fname.c_str()); |
Forum: C++ Aug 31st, 2006 |
| Replies: 6 Views: 1,217 Re: Conditionally initializing arrays HELP You might be able to use a pointer instead. E.g.:
#include <iostream>
const int ARRAY_SIZE = 5;
int array1[] = {1,2,3,4,5};
int array2[] = {6,7,8,9,10};
int* arrays[] = { array1, array2 };
int... |
Forum: C++ Aug 31st, 2006 |
| Replies: 1 Views: 1,840 Re: No appropriate default constructor? MailCarrier's default constructor tries to implicitly call the base class (Employee) constructor. You need to either define a constructor for Employee that takes no arguments, or explicitly call the... |
Forum: C Aug 30th, 2006 |
| Replies: 50 Views: 6,733 Re: C programming - need some help > One more thing, if i can't call main() recursively, can u suggest me any other way to call the main just after finish other function.
You don't need to call main; when your function finishes, it... |
Forum: C++ Aug 29th, 2006 |
| Replies: 2 Views: 2,680 Re: _ has no member named _??? 'person' is a map of maps, not a Person_class, so naturally it won't have those members. person["somestring"]["somestring"] would return (or set) a Person_class, however, so... |