Search Results

Showing results 1 to 40 of 1000
Search took 0.08 seconds.
Search: Posts Made By: ArkM ; Forum: C++ and child forums
Forum: C++ Jun 16th, 2009
Replies: 8
Views: 552
Posted By ArkM
What for this overcomplicated unclear code? What's a programming case where this nightmare required?

This thread was started from a very suspicious-looking remark The compiler forces me to do a...
Forum: C++ Jun 16th, 2009
Replies: 9
Views: 542
Posted By ArkM
1. About C4716: didn't you know that double F_Ite() function must return double type value? And where is return anything-of-double_type in the function body? It's your code, you have wrote double...
Forum: C++ Jun 16th, 2009
Replies: 8
Views: 552
Posted By ArkM
Apropos, your fix_name is wrong. It does nothing (except memory leak).

You modify dynamically allocated copy of the string argument then assign the pointer to the parameter (but not to the...
Forum: C++ Jun 16th, 2009
Replies: 3
Views: 250
Posted By ArkM
And yet another question to OP:
Why you are starting a new thread on the same problem?
Orphaned thread:
http://www.daniweb.com/forums/thread197527.html
;)
Forum: C++ Jun 16th, 2009
Replies: 5
Views: 227
Posted By ArkM
No a proper constructor of the class SipDialogPublish.
Check up class SipDialogPublish definition and types of constructor arguments in the line #343. Probably this constructor was declared but not...
Forum: C++ Jun 16th, 2009
Replies: 3
Views: 250
Posted By ArkM
Yet another tip:

while (infile) // wrong loop!
{
getline(...);
... >> ...
i++
}

See what happens if the file is empty or after the last line reading:
Forum: C++ Jun 15th, 2009
Replies: 1
Views: 318
Posted By ArkM
Try to adopt this improvisation:

const size_t allbut = std::numeric_limits<int>::max();
bool overStep(std::istream& in)
{
char c;
while (in.ignore(allbut,'S')) {
do
...
Forum: C++ Jun 15th, 2009
Replies: 11
Views: 846
Posted By ArkM
Sorry, I have not noticed that you are in ubuntu environment...
It's not a problem in the Visual Studio debugger.
Forum: C++ Jun 15th, 2009
Replies: 4
Solved: Organising code
Views: 317
Posted By ArkM
Don't worry, it's a small code ;)
Try to split functions into separate groups by themes (as usually, it's possible to do). Place every group in a separate cpp file (don't forget to add it to the...
Forum: C++ Jun 15th, 2009
Replies: 11
Views: 846
Posted By ArkM
It's not an error at all. It's a simple info message. Fill the difference.
Forum: C++ Jun 15th, 2009
Replies: 11
Views: 420
Posted By ArkM
Insert std::cin.ignore(1000,'\n'); after std::cin >> diameter;
Forum: C++ Jun 15th, 2009
Replies: 11
Views: 420
Posted By ArkM
>...why is this i cannot see anything wrong with my code...
Oh, this harmful Daniweb engine! I see 'area' in the OP snippet but area in the post #3 code ;)
By the way, change char area; to float...
Forum: C++ Jun 15th, 2009
Replies: 5
Views: 574
Posted By ArkM
>...because if you just put a and b without quotes, the compiler will think that you are using the variables a and b.
That's exactly what OP intends to do ;)
Forum: C++ Jun 15th, 2009
Replies: 11
Views: 420
Posted By ArkM
Fill a glass with water (or what else) then drink, not vice versa ;)

Calculate a circle area AFTER its diameter request.
Output the area variable, not a wrong character literal 'area'...
Forum: C++ Jun 15th, 2009
Replies: 8
Views: 1,322
Posted By ArkM
After that place all system header includes in StdAfx.h (and remove them from .cpp files (after #include "StdAfx.h")...
Forum: C++ Jun 15th, 2009
Replies: 5
Views: 432
Posted By ArkM
>I'm not quite sure what exactly you mean. I'm really new to C++. Can you explain a bit more clearly?
OK, let's come back to the class Path design. The class has a member function without...
Forum: C++ Jun 15th, 2009
Replies: 8
Views: 413
Posted By ArkM
Well, your program crashed. It looks like a mere assertion, not a question.
Read This Before Posting: http://www.daniweb.com/forums/thread78223.html.
Never send exe files in attachments!
Forum: C++ Jun 15th, 2009
Replies: 5
Views: 432
Posted By ArkM
What a wonderful teleportation of argv[3] to every class Path object do you want? If you have a "default" starting point of the Path object (probably it's the scArg member), provide this class for a...
Forum: C++ Jun 15th, 2009
Replies: 2
Views: 272
Posted By ArkM
>I have found lots of ways to do this if I want all of the elements of the string but not how to do it when I only want certain parts.
What's a funny statement... If you can get all elements (by the...
Forum: C++ Jun 15th, 2009
Replies: 6
Views: 311
Posted By ArkM
Of course, it's not a stupid question but it's impossible to answer in a few words.
Look at
http://www.is.pku.edu.cn/~qzy/cpp/vc-stl/templates.htm...
Forum: C++ Jun 15th, 2009
Replies: 17
Views: 1,105
Posted By ArkM
If so, mark this thread as solved ;)
Forum: C++ Jun 14th, 2009
Replies: 2
Views: 293
Posted By ArkM
Better use std::string class:

#include <iostream>
#include <string>
using namespace std;
...
string day;
...
getline(cin,day);
if (day == "Mo") ...
Forum: C++ Jun 14th, 2009
Replies: 3
Views: 314
Posted By ArkM
Look at DISLIN (free for personal use):
http://www.mps.mpg.de/dislin/
Forum: C++ Jun 14th, 2009
Replies: 17
Views: 1,105
Posted By ArkM
1. Well, reserve size (if no need in some postprocessing)
2. Tastes differs; for example, I prefer to return bool in such cases. I think, returned size if more useful than 0. Moreover, zero on...
Forum: C++ Jun 14th, 2009
Replies: 17
Views: 1,105
Posted By ArkM
The wittingly wrong statement in OP code is delete buffer; - must be delete[]buffer;. Yet another defect: insufficient error check-up.

long GetFileSize(ifstream &file)
{
static const...
Forum: C++ Jun 13th, 2009
Replies: 5
Views: 241
Posted By ArkM
See what a class of that sort (std::string surrogate) must have:

class Testing
{
public:
Testing();
Testing(const char*);
Testing(const Testing&); // copy constructor
Testing&...
Forum: C++ Jun 13th, 2009
Replies: 3
Views: 694
Posted By ArkM
Right direction but lots of defects in OP code.
The OP title does not bear a relation to the real OP problems.
Think about:

// Never fix array size in a function!
int getLargest(const int* a,...
Forum: C++ Jun 12th, 2009
Replies: 5
Views: 299
Posted By ArkM
There is a very strange syntax construct in your code:

switch (dom_destination)


do {
case 1:

Of course, it's an error, but syntactically switch statement in C and C++ looks as...
Forum: C++ Jun 12th, 2009
Replies: 6
Views: 361
Posted By ArkM
Your constructor variant with assignments has the same effect as mine. However as usually assignments in constructors (or even anywhere) are less effective than initialization with ctor-initializers...
Forum: C++ Jun 12th, 2009
Replies: 6
Views: 361
Posted By ArkM
In addition:
Change lines 40-45 in my code above to

/// more syntax sugar for lazies
const Suite
&Hearts = Suite::Hearts,
&Clubs = Suite::Clubs,
&Diamonds = Suite::Diamonds,
...
Forum: C++ Jun 12th, 2009
Replies: 6
Views: 361
Posted By ArkM
This part is so called ctor-initializer-list. In C++ it's a preferred way to initialize class members and the only method to pass constructor arguments to base class(es) constructors (the last...
Forum: C++ Jun 12th, 2009
Replies: 4
Views: 319
Posted By ArkM
Are you sure that your method is not efficient?
Why?..
What's your efficiency criterion?
Forum: C++ Jun 12th, 2009
Replies: 6
Views: 361
Posted By ArkM
Of course, all possible in C++ ;)
That's an improvisation:

/// suite.h (class Suite definition)
class Suite
{
public:
Suite() {}
Suite(const Suite& suit):value(suit.value) {}
...
Forum: C++ Jun 11th, 2009
Replies: 16
Solved: Bits in a byte
Views: 756
Posted By ArkM
>What evil being designed such a thing?!
Probably, it was the hardware architect's acute condition ;)
Many years ago...
Forum: C++ Jun 11th, 2009
Replies: 6
Solved: Return pointer
Views: 488
Posted By ArkM
>I want the minimal pointer because it is the left most node for my tree.
The leftmost node in the tree is not the same as the minimal pointer!
Moreover, a pointer value does not bear a relation to...
Forum: C++ Jun 11th, 2009
Replies: 16
Solved: Bits in a byte
Views: 756
Posted By ArkM
>not many people will ever touch something like a 4-bit machine or any other sort of setup.
None the less there were supercomputers with 6-bits and 9-bits (or may be 12) bytes ;)
Moreover, I have...
Forum: C++ Jun 11th, 2009
Replies: 6
Solved: Return pointer
Views: 488
Posted By ArkM
>I dont want the data inside i want the pointer
Which pointer do you want (and why) - that's a question ;)

If you want the minimal pointer value ( why?! ) - you have it. What's a problem? Well,...
Forum: C++ Jun 11th, 2009
Replies: 2
Views: 599
Posted By ArkM
If you wrote a text line on a paper sheet, you can't insert anything in this line without a rubber and rewriting or a glue and scissors. A file storage looks like a paper, however it's impossible to...
Forum: C++ Jun 11th, 2009
Replies: 6
Solved: Return pointer
Views: 488
Posted By ArkM
Probably you want a pointer which points to the minimal data value. In actual fact it's (as usually) senseless operation to compare pointer values. Moreover, the result of pointers comparison is...
Forum: C++ Jun 11th, 2009
Replies: 3
Views: 331
Posted By ArkM
>I believe static libraries are included within the executables...
The linker searches static libraries for object (compiled) modules needed to built an executable. For example, suppose you build a...
Showing results 1 to 40 of 1000

 


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

©2003 - 2009 DaniWeb® LLC