Search found 4 matches

Return to advanced search

Re: c++ program i made. Having a problem.

You weren't returning a value from your function. Instead of cout << result; you should have used return result; Also, if you initialize return to 0, you have to do count < i, not count <= i. Here is the code I got working. Let me know if you have any more questions: // implement square(...
by Cethin
on Thu Jun 09, 2011 4:24 pm
 
Forum: C and C++
Topic: c++ program i made. Having a problem.
Comments: 3
Views: 6246

Displaying an Object

Hello all, I was wondering if anyone knew if you could display an Object without passing it. I've created a very basic Board class. Here is the class and it's constructor: class Board { public: Board(int rows = 0, int columns = 0); void Display() const; private: int m_rows, m_columns; }; Boa...
by Cethin
on Tue Jun 07, 2011 5:03 pm
 
Forum: C and C++
Topic: Displaying an Object
Comments: 0
Views: 3134

Re: Basic C Question

Thetan, thank you for that code example. I learned some things from it, however I have not yet learned anything about pointers, so I'll have to go read up on those and come back to that. Arameus, thank you for pointing that out, I hadn't thought of that. I was using a blank because I wasn't allowed ...
by Cethin
on Thu May 12, 2011 1:26 am
 
Forum: C and C++
Topic: Basic C Question
Comments: 21
Views: 17534

Basic C Question

I'm fairly new to programming, so this is a fairly simple problem. Writing a function that takes two strings, and removes all the letters in one that match the other (ex: 'testing' and 'test', resulting string would be 'ing'). I have written it so it works, but I was wondering if anyone had advice o...
by Cethin
on Wed May 11, 2011 5:29 pm
 
Forum: C and C++
Topic: Basic C Question
Comments: 21
Views: 17534

Return to advanced search