Search Results

Showing results 1 to 40 of 104
Search took 0.01 seconds.
Search: Posts Made By: Stoned_coder ; Forum: C++ and child forums
Forum: C++ Oct 24th, 2005
Replies: 13
Views: 9,856
Posted By Stoned_coder
template member functions may not be virtual but often you can get around this by templating a class rather than a member function. The only reason you cant have template member functions is because...
Forum: C++ Oct 12th, 2005
Replies: 1
Views: 7,392
Posted By Stoned_coder
there is a need and a reason to return arrays and it can be done, you just return a pointer to its first address. If what you meant was an array return by value, i.e. a copy of the array then yes...
Forum: C++ Oct 11th, 2005
Replies: 6
Views: 8,588
Posted By Stoned_coder
private inheritance has its uses. It is similar in effect to composition and nothing like public inheritance. When you become more familiar with c++, you will often find uses for private inheritance.
Forum: C++ Oct 11th, 2005
Replies: 6
Views: 8,588
Posted By Stoned_coder
no its not legal. because you have used private inheritance your class now looks like this.....

class Bird
{
public:
Bird();
virtual ~Bird();
private:
void...
Forum: C++ Oct 6th, 2005
Replies: 2
Views: 9,244
Posted By Stoned_coder
it is. passing a pointer is no different to passing anything else. Its a parameter the same as any other.
Forum: C++ Oct 4th, 2005
Replies: 4
Views: 3,321
Posted By Stoned_coder
well in c++ you dont need to do that. you can get input like this....

int an_int;
while( ! cin>>an_int )
{
// didnt get an int so deal with that here
cin.clear(); // clear error flags
...
Forum: C++ Oct 4th, 2005
Replies: 8
Views: 14,868
Posted By Stoned_coder
you appear to be mixing managed and unmanaged c++. I dont think you can do that although I aint sure i dont use managed c++
Forum: C++ Oct 4th, 2005
Replies: 2
Views: 4,414
Posted By Stoned_coder
something like

long long int summation(long long int start, long long int howMany)
{
long long sum=0;
for(long long i=0,j=start;i<howMany;++i,++j)
sum += j;
return sum;
}
Forum: C++ Oct 4th, 2005
Replies: 4
Views: 3,321
Posted By Stoned_coder
perhaps if you explain better what you are trying to do. maybe a small code sample. Why would you need to type check after a cin.
Forum: C++ Oct 2nd, 2005
Replies: 2
Views: 1,174
Posted By Stoned_coder
Its extrememly dated. If you are in any way serious about programming you will want the best tools you can get for free or for the money available. There are many compilers available for free on the...
Forum: C++ Oct 2nd, 2005
Replies: 11
Views: 2,589
Posted By Stoned_coder
understand what the code is doing. In main you make an input file and read it a line at a time. You then pass that line to myjob::read. This is where the parsing occurs. first an istringstream is...
Forum: C++ Sep 30th, 2005
Replies: 8
Views: 14,868
Posted By Stoned_coder
#include<windows.h>??
Forum: C++ Sep 30th, 2005
Replies: 1
Views: 1,212
Posted By Stoned_coder
look at your operators
Forum: C++ Sep 29th, 2005
Replies: 8
Views: 14,868
Posted By Stoned_coder
look up in your helpfiles or at msdn....

the third param to WinMain to get command line as ascii
GetCommandLine() to get the command line as unicode
CommandLineToArgvW() to convert it to an...
Forum: C++ Sep 29th, 2005
Replies: 2
C++
Views: 1,348
Posted By Stoned_coder
we dont do your homework, we only help when you show effort.
Forum: C++ Sep 28th, 2005
Replies: 1
Views: 7,521
Posted By Stoned_coder
know how to write a text file? should be examples in all c++ texts. or alternatively there are a couple of libraries available to do logging, check on sourceforge.
Forum: C++ Sep 28th, 2005
Replies: 10
Views: 2,685
Posted By Stoned_coder
What compiler are you using?
You will need something reasonably standards conforming. You can get one in my sig.
Forum: C++ Sep 28th, 2005
Replies: 10
Views: 2,685
Posted By Stoned_coder
what I meant is illustrated below. it breaks my heart to write all of this in the main function but it seems as if you havent learnt functions yet so I tried not to get too far ahead. I have shown...
Forum: C++ Sep 27th, 2005
Replies: 10
Views: 2,685
Posted By Stoned_coder
ok then.
firstly the correct header is <iostream> not <iostream.h>.

using std::cout;
using std::cin;
using std::endl;
can be removed. You have already said that you are using the whole of...
Forum: C++ Sep 27th, 2005
Replies: 10
Views: 2,685
Posted By Stoned_coder
post some code to show you have attempted the problem if you want help. We dont handfeed you homework answers but will happily help you out if you show effort.
Forum: C++ Sep 26th, 2005
Replies: 2
Views: 2,289
Posted By Stoned_coder
ptr.speak();
ptr.move();
ptr.printName();

not . its ->
Forum: C++ Sep 25th, 2005
Replies: 13
Views: 2,718
Posted By Stoned_coder
int a=rand();
int b=rand();
int c=rand();
std::vector<int> vec;
vec.push_back(a);
vec.push_back(b);
vec.push_back(c);
std::cout<< *std::min_element(vec.begin(),vec.end())<<std::endl;

not a...
Forum: C++ Sep 25th, 2005
Replies: 15
Views: 3,696
Posted By Stoned_coder
yes it is standard, but it took a while for some compilers to catch up, most notably msvc6. There is also a nothrow version of new specified by the standard.
Forum: C++ Sep 25th, 2005
Replies: 8
Views: 2,127
Posted By Stoned_coder
you cant. watch.


int x=0; // global x
int main()
{
int x=1; // main x
{
int x=2; // block x
cout<< x<<endl; // prints block x
Forum: C++ Sep 21st, 2005
Replies: 9
Views: 2,047
Posted By Stoned_coder
your probably overstepping the bounds of an array somewhere. Other than that its hard to say without seeing code. we are not psychics.
Forum: C++ Sep 21st, 2005
Replies: 5
Views: 2,970
Posted By Stoned_coder
operator ++ and -- with no arguments return a reference to an object and not an object itself. bman you should have known better.
Forum: C++ Sep 20th, 2005
Replies: 8
Views: 5,305
Posted By Stoned_coder
protected data members are virtually a no-no. what normally goes into the protected section are member functions, especially virtuals which may need to be called from derived classes but not...
Forum: C++ Sep 20th, 2005
Replies: 2
Views: 1,256
Posted By Stoned_coder
Your hangman class is missing a }; at the end. take care to punctuate properly
Forum: C++ Sep 20th, 2005
Replies: 7
Views: 11,403
Posted By Stoned_coder
Yes it is!
Forum: C++ Sep 18th, 2005
Replies: 4
Views: 2,370
Posted By Stoned_coder
no as an array.

yes as a pointer or object such as std::vector
Forum: C++ Sep 16th, 2005
Replies: 1
Views: 1,167
Posted By Stoned_coder
I fail to see whats so special about vista. I have checked out the beta. All the things I was looking forward to didnt make it in. Its not that much different from XP. What have the microsoft...
Forum: C++ Sep 16th, 2005
Replies: 3
Views: 1,552
Posted By Stoned_coder
typo here

cout<<" Enter your last name :";
cin>> last;

cout<<" Enter your last name :"<<endl;
cin>>first;
Forum: C++ Sep 14th, 2005
Replies: 5
Views: 3,054
Posted By Stoned_coder
you dont need to know windows api to use opengl. its independant of windows. The only time you need windows coding is if you want your opengl app to run in a window instead of full screen.
theres...
Forum: C++ Sep 14th, 2005
Replies: 7
Views: 2,952
Posted By Stoned_coder
ok might be a bug. somethings trampling on your vector. Set a watch on the vectors first few elements and single step thru your code in a debugger. watch for the point where the trampling occurs and...
Forum: C++ Sep 13th, 2005
Replies: 7
Views: 2,952
Posted By Stoned_coder
lol there is no bug dave. its a feature!
Forum: C++ Sep 13th, 2005
Replies: 7
Views: 2,952
Posted By Stoned_coder
read this all should become clearer (http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=205&rl=1)
Forum: C++ Sep 13th, 2005
Replies: 8
Views: 7,798
Posted By Stoned_coder
ok lets go thru your code....

your exception classes will need default constructors or arguments passed to them.

destructor doesnt need if(s). just the delete[]s will do nicely.

throw...
Forum: C++ Sep 13th, 2005
Replies: 8
Views: 7,798
Posted By Stoned_coder
why stacks?
Heres a palindrome proggy i did for another board.

#include <iostream>
#include <string>
#include <cctype>

int IsMirrorPalindrome( const char* word, size_t length )
{
if(...
Forum: C++ Sep 13th, 2005
Replies: 3
Views: 1,827
Posted By Stoned_coder
how do you know whats in stock? do you read that info from a file? you gotta enter it by hand?

You can use the STL to simplify your exercise.

I would probably use a sorted vector of structs(or...
Forum: C++ Sep 12th, 2005
Replies: 8
Views: 3,843
Posted By Stoned_coder
its gotta be. If you include string in the first example, it should work. If you include functional in mine, it will work and also daishis example is valid too. You can get a different version of the...
Showing results 1 to 40 of 104

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC