Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
Ranked #16.0K
Ranked #3K
~3K People Reached
Favorite Forums
Favorite Tags
c++ x 12
c x 1

11 Posted Topics

Member Avatar for dowens3rd

Heres a simple solution using the stl #include <iostream> #include <algorithm> #include <vector> int main() { //sort using a char array. char cArr[] = "15462"; int len = strlen(cArr); std::sort(cArr, cArr + len); std::cout<<"Sorted char array is: "<<cArr<<"\n"; //or we can sort on vector or any other container std::vector<int> num; …

Member Avatar for dowens3rd
0
200
Member Avatar for jtxay

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 julian numbers.

Member Avatar for 1o0oBhP
0
158
Member Avatar for riturajraina

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 what you want, but its the closest thing i could think of

Member Avatar for varunrathi
0
428
Member Avatar for Marivel

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 elements here } }; std::sort(container.begin(),container.end(),containerCompare());

Member Avatar for britt_boy
0
211
Member Avatar for KittyGirl

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 [CODE]....triangleShape(float A, float B, float C)[/CODE] I think your instructor means you to have shape of type …

Member Avatar for jwenting
0
194
Member Avatar for gallas

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. [CODE]class classone { public: classone(const classtwo& classtworef) :m_classtworef(classtworef) { //reference members can only be initialized in member initialization list } const classtwo& …

Member Avatar for jwenting
0
198
Member Avatar for SquirrelProdigy

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 wrong. The compiler will let you cast anything to anything. You cannot cast …

Member Avatar for SquirrelProdigy
0
142
Member Avatar for sachin kumar

Heres a snippet in mfc for finding a file of form *.extension in directory = myDirectory [CODE] // Get a list of files CFileFind finder; BOOL finding = finder.FindFile (myDirectory + CString ("\\*.") + extension); //iterate the results while (finding) { finding = finder.FindNextFile(); //get file path CString path = …

Member Avatar for britt_boy
0
78
Member Avatar for see_moonlight

You can use max_element #include <iostream> #include <vector> #include <algorithm> using namespace std; int main(int) { const int len = 3; const int start = 0; double arr[len]; arr[0]= 2.4; arr[1] = 1.2; arr[2] = 3.67; double* first = arr; double* last = arr + len - 1; //get min …

Member Avatar for britt_boy
0
881
Member Avatar for fivetoesonefoot

Swithc works with integral types, so inPlanet (float) will not work. Instead, try this cin >> planet;

Member Avatar for britt_boy
0
90
Member Avatar for badchick

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 buffer, so make sure your string goes out of scope after you have finished with …

Member Avatar for britt_boy
-1
158

The End.