Search Results

Showing results 1 to 13 of 13
Search took 0.01 seconds.
Search: Posts Made By: britt_boy
Forum: C++ Dec 15th, 2004
Replies: 4
Solved: sorting
Views: 2,356
Posted By britt_boy
Heres a simple solution using the stl


#include <iostream>
#include <algorithm>
#include <vector>
int main()
{
//sort using a char array.
char cArr[] = "15462";
Forum: C++ Dec 9th, 2004
Replies: 4
Views: 3,230
Posted By britt_boy
Your code compiles ok on vc++ 6. Your only calculating the julian day number using year, month and day. You need to do the same for year2, month2, day2 and then find the difference between the two...
Forum: C++ Dec 9th, 2004
Replies: 6
Views: 2,800
Posted By britt_boy
Have you thought of using the sort algorithm in the stl, and a compare func

struct containerCompare
{
bool operator()(const Type& p1, const Type& p2) const
{

//compare your...
Forum: C Dec 9th, 2004
Replies: 2
Views: 4,885
Posted By britt_boy
If your working with MFC, theres a function

CreateProcess(.........)

That will launch an exe in its own thread. Its up to you to keep peeking at any messages it sends. Dont know if this is...
Forum: C++ Dec 9th, 2004
Replies: 3
Views: 7,651
Posted By britt_boy
Fist thing you need to do is change the prototype of triangleShape. Since it has to usethe lengths of the triangle you need to pass them into it. It needs to look like

....triangleShape(float...
Forum: C++ Dec 7th, 2004
Replies: 11
Views: 3,598
Posted By britt_boy
Just to agitate things up a little. The problem can aslo be solved by use of const or non-const reference members and is similar to the pointer version.

class classone
{
public:
...
Forum: C++ Dec 7th, 2004
Replies: 2
Views: 20,982
Posted By britt_boy
Heres a snippet in mfc for finding a file of form *.extension in directory = myDirectory


// Get a list of files
CFileFind finder;
BOOL finding = finder.FindFile (myDirectory +...
Forum: C++ Dec 6th, 2004
Replies: 6
Views: 10,165
Posted By britt_boy
Yep better and easier to use vector. The orig post referred to an array so i thought i would be strict and stick with that.
Forum: C++ Dec 6th, 2004
Replies: 4
Views: 3,753
Posted By britt_boy
Firstly, a struct is almost the same as class. The only difference is that evrything is public by default. For a class the default is private

Secondly what you are trying do do with the cast is...
Forum: C++ Dec 6th, 2004
Replies: 6
Views: 10,165
Posted By britt_boy
My mistake. I originally wrote it using a vector then realized i could convert it to use an array, then forgot about .end() for the array.
Forum: C++ Dec 6th, 2004
Replies: 6
Views: 2,039
Posted By britt_boy
Swithc works with integral types, so inPlanet (float) will not work. Instead, try this

cin >> planet;
Forum: C++ Dec 6th, 2004
Replies: 6
Views: 10,165
Posted By britt_boy
You can use max_element


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int)
{
const int len = 3;
Forum: C++ Dec 6th, 2004
Replies: 3
Views: 2,133
Posted By britt_boy
atoi requires const char*as an argument. string is a specialization of basic_string and is not a const char*. Call method c_str() on the string to get const char*. string owns the memory for the char...
Showing results 1 to 13 of 13

 


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

©2003 - 2009 DaniWeb® LLC