Showing results 1 to 40 of 65
Search took 0.01 seconds.
Posts Made By: GloriousEremite
Forum: C++ Mar 23rd, 2007
Replies: 14
Views: 3,161
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
Re: string in c++,segmentation fault,thread

Could you post a short program that demonstrates the problem (and that we can actually compile)?
Forum: C++ Oct 9th, 2006
Replies: 8
Views: 4,086
Posted By GloriousEremite
Re: array of structures within a struct

The first part looks ok to me, but for the second part you also need to allocate space for each pointer in the array
Forum: C++ Oct 9th, 2006
Replies: 7
Views: 3,252
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
Re: I can't understand "C++ pointer". Please help me!! (code included)

What do you expect to happen? After you increment 'p' in your third loop, it points past the last element of the array, so you're bound to get garbage data on your last outputs.
Forum: C++ Oct 4th, 2006
Replies: 7
Views: 1,131
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
Re: Need some help with n00b code project

Is that table correct? I would think that you should start with two rabbits, then the number should double each month (i.e., exponential growth of 2^x)
Forum: C++ Oct 1st, 2006
Replies: 7
Views: 2,059
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
Re: why should we always use "CALLBACK" and "WINAPI" these words

Some more info can be found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows_data_types.asp

Namely, it says that WINAPI and CALLBACK are both defined...
Forum: C++ Sep 12th, 2006
Replies: 8
Views: 8,066
Posted By GloriousEremite
Re: Working in Visual C++ to parse some text files

Look at std::ifstream (http://www.cplusplus.com/ref/iostream/ifstream/). E.g.:

#include <fstream>
#include <string>
//...
std::ifstream infile("somefile");
if (!infile.good())
{
//failed to open
}
Forum: C++ Sep 11th, 2006
Replies: 4
Views: 1,121
Posted By GloriousEremite
Re: need help in overloading function w/ in the class.

How about reformmating that/adding code tags?
Forum: C Sep 11th, 2006
Replies: 1
Views: 1,132
Posted By GloriousEremite
Re: what is different between hIconSm and hIcon?

Try pressing alt-tab. It might appear elsewhere as well, but I can't think of where at the moment.
Forum: C Sep 11th, 2006
Replies: 5
Views: 1,525
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
Re: Calculating a control position on a window

Could you post a short example program that we can compile, and that demonstrates the problem?
Forum: C++ Sep 9th, 2006
Replies: 5
Views: 1,253
Posted By GloriousEremite
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
Posted By GloriousEremite
Re: Met problems with my first win32 program

Make sure you created a Win32 project and not a console project (how to do that depends on your IDE)
Forum: C++ Sep 7th, 2006
Replies: 2
Views: 759
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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
Posted By GloriousEremite
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...
Showing results 1 to 40 of 65

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:46 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC