Search Results

Showing results 1 to 40 of 978
Search took 0.06 seconds.
Search: Posts Made By: mitrmkar
Forum: C++ Apr 1st, 2009
Replies: 19
Views: 1,562
Posted By mitrmkar
I doubt that anyone here will take up the task of modifying the program.

A slight chance of getting some sort of assistance might be to contact the author, his contact information is available on...
Forum: C Mar 31st, 2009
Replies: 4
Views: 325
Posted By mitrmkar
Maybe Beej's Guide to Network Programming (http://beej.us/guide/bgnet/output/html/multipage/index.html)
Forum: C Mar 31st, 2009
Replies: 10
Solved: minmax
Views: 640
Posted By mitrmkar
There is an initialization failure ...

for( i = 0; i < n; i++ ) numberlist[i] == rand() % n ;
Forum: C++ Mar 31st, 2009
Replies: 3
Views: 407
Posted By mitrmkar
I think the two friend declarations need template <class T>

template <class T>
class Tree
{
...
template <class T> friend void buildExprTree(Tree<T> & expr);
template <class T> friend int...
Forum: C++ Mar 30th, 2009
Replies: 3
Views: 2,257
Posted By mitrmkar
Yes, those *'s have been there for quite some time ...;)
Forum: C++ Mar 30th, 2009
Replies: 7
Views: 360
Posted By mitrmkar
PointFriend must be a friend of Point because PointFriend's constructor accesses a private member of Point (i.e. P.x).

Whether or not "friend class Point;" is declared in the above example makes...
Forum: C++ Mar 30th, 2009
Replies: 3
Views: 437
Posted By mitrmkar
Looking at your previous post, there's an orphan if there ...

break;
case '#':
if
break;
default:
Forum: C++ Mar 30th, 2009
Replies: 13
Views: 629
Posted By mitrmkar
Yes, you are missing semicolons ...

void bird :: double travel_time (double distance, terrain_type t)
{
switch (t)
{
case PLAIN: travel_time = ((distance/landspeed)*1) ;...
Forum: C++ Mar 28th, 2009
Replies: 8
Views: 736
Posted By mitrmkar
// in this case, there are 20 bytes available for use at ptr[0 .. 4],
// one use might be by means of strcpy()
strcpy(ptr[0], "Hello ");
strcpy(ptr[1], "wond");

// cleanup ...
for(int i = 0;...
Forum: C++ Mar 28th, 2009
Replies: 11
Views: 536
Posted By mitrmkar
You can use const_cast, i.e.

Node * temp = const_cast<Node*>(this);

Maybe you could revise the 'constness' of the code (I did not look too closely). Perhaps read about Const correctness...
Forum: C++ Mar 28th, 2009
Replies: 8
Views: 736
Posted By mitrmkar
That is not quite correct, see comments

int main(void)
{
/* Declare the '2D Array' */
char ** ptr = new char * [5];
ptr[0] = new char[20];
ptr[1] = new char[20];
ptr[2] =...
Forum: C++ Mar 28th, 2009
Replies: 24
Views: 1,318
Posted By mitrmkar
Yes. A suggestion, maybe first exercise with a smaller problem, e.g. try to simulate the "(0 <= n <= 1) to move row n right 1 position".
You might have ...

const int COLS = 3;
int array[COLS] =...
Forum: C++ Mar 28th, 2009
Replies: 24
Views: 1,318
Posted By mitrmkar
Hmm, but looking closely at initPuzzle(), it clearly achieves the scrambling by calling movePuzzle(...) on two occasions.

// scramble the puzzle
for (y=0; y<=ROWS*COLS; y++) {
if...
Forum: C++ Mar 28th, 2009
Replies: 24
Views: 1,318
Posted By mitrmkar
As per the code you are given in puzzle.h, the scrambling of the puzzle is actually done by means of the movePuzzle(), hence I asked about its code. If you haven't coded it yet, your output will be...
Forum: C++ Mar 28th, 2009
Replies: 24
Views: 1,318
Posted By mitrmkar
What code you have in movePuzzle(...)?
Forum: C++ Mar 27th, 2009
Replies: 24
Views: 1,318
Posted By mitrmkar
Oh I see, let the professor have his/her ways then. But in the future, you know to avoid atoi().
Forum: C++ Mar 27th, 2009
Replies: 24
Views: 1,318
Posted By mitrmkar
About converting the seed, you'd be better of using stringstream (atoi() is a poor choice for that). Below is a snippet for the
conversion ...

#include <sstream>
#include <iostream>
using...
Forum: C++ Mar 27th, 2009
Replies: 3
Views: 709
Posted By mitrmkar
Think of bar->second as a map <string, int>, so simply ...

bar->second["abc"] = 123;
Forum: C++ Mar 27th, 2009
Replies: 12
Views: 393
Posted By mitrmkar
Maybe you could post the "includes.h" file?
Forum: C Mar 24th, 2009
Replies: 13
Views: 1,922
Posted By mitrmkar
Maybe print the error message (see grapherrormsg(...)) to a file to get a clue about what's wrong.
Forum: C++ Mar 24th, 2009
Replies: 10
Views: 404
Posted By mitrmkar
Problem is that x is not initialized to zero (I take that you simply want to swap the values).

You might have it a bit simpler like ...

if (numB < numA)
{
// use x only inside the...
Forum: C++ Mar 24th, 2009
Replies: 4
Views: 392
Posted By mitrmkar
When you tried that and noticed that problem, are you sure that you did not have the d.clear(); call. Because the clear(), as you now have it, will empty the vector (of the tmp Demo object) so you'll...
Forum: C++ Mar 24th, 2009
Replies: 4
Views: 392
Posted By mitrmkar
Pass the vector by reference just like you already pass the Demo object.

istream& operator>> (std::istream& in, vector<double> & d);
std::istream& operator>> (std::istream& in, vector<double> &...
Forum: C++ Mar 23rd, 2009
Replies: 7
Views: 343
Posted By mitrmkar
Some comments ...

//Adding the two numbers together
int Add(int num1, int num2)
{
int addedTotal;
// sum up the values ...
addedTotal = num1 + num2;
// display text ...
cout << "The two...
Forum: C++ Mar 23rd, 2009
Replies: 7
Views: 343
Posted By mitrmkar
As long as you have an internet connection, you can always check online, whether or not your code compiles. Below are couple links:
Comeau (http://www.comeaucomputing.com/tryitout/)
and ...
Forum: C++ Mar 22nd, 2009
Replies: 3
Views: 1,451
Posted By mitrmkar
If you represent the values as integers (e.g. 0 .. 100), then it will work. So a working .ini file might look like ..

[section]
; with % -sign
value1=15%
; without % -sign
value2=99
Forum: C++ Mar 21st, 2009
Replies: 38
Views: 2,973
Posted By mitrmkar
Maybe your codeblocks is old enough to not to have the following definitions

#ifndef SHTDN_REASON_MAJOR_OTHER
#define SHTDN_REASON_MAJOR_OTHER 0x00000000
#define...
Forum: C++ Mar 21st, 2009
Replies: 38
Views: 2,973
Posted By mitrmkar
Did you get the UAC prompt when you ran the shutdown.exe command? If you did, then you'll need a manifest like jbennet showed.



I think it is rather a Policy Configuration issue, i.e. "Shut...
Forum: C++ Mar 21st, 2009
Replies: 38
Views: 2,973
Posted By mitrmkar
Maybe you could try out the following program, and post back its output. It might give some clue about what is not working.


#include <windows.h>
#include <stdio.h>

BOOL SetPrivilege
(
...
Forum: C++ Mar 21st, 2009
Replies: 3
Views: 1,451
Posted By mitrmkar
See GetPrivateProfileInt Function (http://msdn.microsoft.com/en-us/library/ms724345(VS.85).aspx)
Forum: C++ Mar 20th, 2009
Replies: 38
Views: 2,973
Posted By mitrmkar
Nothing in the MSDN documentation on ExitWindowsEx() indicates that. How did you came into that conclusion?
Forum: C++ Mar 20th, 2009
Replies: 38
Views: 2,973
Posted By mitrmkar
There might be many reasons, e.g. any application you have open may also abort the shutdown (since you are not forcing it), maybe your system does not support the power-off feature or your program...
Forum: C++ Mar 19th, 2009
Replies: 2
Views: 397
Posted By mitrmkar
What on earth "TP and others" means?
Forum: C++ Mar 18th, 2009
Replies: 9
Views: 455
Posted By mitrmkar
There is a contradiction, in your first post you say that "Each file has: #include "include.h"". If enum.cpp actually includes include.h, that results in the error you described.


Assuming...
Forum: C++ Mar 18th, 2009
Replies: 23
Views: 981
Posted By mitrmkar
Now remember the second parameter to write(), that specifies how many bytes are written.

PS. Maybe you could try to re-post your code
Forum: C++ Mar 16th, 2009
Replies: 4
Views: 225
Posted By mitrmkar
Learn how to use code tags (http://www.daniweb.com/forums/announcement8-3.html), without code tags, your code is pretty much unreadable.

If you expect to be helped, shouldn't you ask a question?
Forum: C++ Mar 16th, 2009
Replies: 23
Views: 981
Posted By mitrmkar
It seems that you are desperately trying various ways to write the file.

Maybe relax and try to master e.g. a binary .pnm file of a very small size, say 2x2 pixels hence being easily viewed in...
Forum: C++ Mar 16th, 2009
Replies: 17
Views: 1,150
Posted By mitrmkar
Umm, maybe you misunderstood me (?). I was not trying to say that MSVC 6.0 cannot be used on Windows versions later than "Windows Server 2003".

Instead, I was trying to say that the "Windows...
Forum: C++ Mar 16th, 2009
Replies: 17
Views: 1,150
Posted By mitrmkar
You might look at Using Visual C++ 2008 Express with the Windows SDK (http://blogs.msdn.com/windowssdk/archive/2008/02/22/using-visual-c-2008-express-with-the-windows-sdk-detailed-version.aspx)
Forum: C++ Mar 16th, 2009
Replies: 17
Views: 1,150
Posted By mitrmkar
Don't ever replace/modify the system header files, instead simply get a complete SDK, which is guaranteed to be compatible with your compiler.
Showing results 1 to 40 of 978

 


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

©2003 - 2009 DaniWeb® LLC