Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is this a question? If it is, then I don't get it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

are you looking for a web hosting service? If yes, there are hundreds of them. Just google for it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Read Vernon's previous post.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why do you think that function is part of stl library?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

cout<<fixed << setprecision(50)<<"i is : "<<i< ...

Don't be supprised when it displays this:

i is : 100 fact is : 933262154439440900000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000.00000000000000000000000000000000000000000000000000

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

cin.ignore() does not affect any of the characters in the std::string, only characters in the input buffer. If you want to delete the period from std::string then you have to do it some other way. For example, one way to do it is like this:

std::string line;
line = "Hello World.";
size_t pos = line.find('.');
if(pos != string::npos)
   line = line.substr(0,pos);
cout << string << "\n";
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Assert is only one debugging tool, and does nothing if you compile the program for release instead of debug. Exception handling works in both debug and release compiles, asserts do not.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Might be a missing semicolon previous to line 81 in the *.cpp file, or missing header file, or missing declaration of INBUFF and OUTBUFF, or a host of other things.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is an extensive thread that discusses how to use it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't know how to do it because I have never seen HWND be a pointer to a structure with those items. I just tried it with VC++ 6.0 and it has the same problem. So I guess what you compiled before was wrong too. Check your work carefully -- my guess is that hwnd should not have been on those two lines.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In VC++ 2008 UNICODE is turned on by default :( . AFAIK there is no way to change this default behavior when creating a project. I always have to turn it off as ArkM posted.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

warning c4996 -- Microsoft has declared many of the standard C functions from stdstring.h decpreciated (obsolete). The c and c++ standards say otherwise. So you have a choice: 1) ignore the warnings, they can be disabled with this pragma: #pragma warning(disable: 4996) , or 2) fix the problems by using Microsofts safe, but non-standard, replacements that are suggested in the warning. I just ignore and disable them.


The error on line 217: This is a true error. HWND is not a structure but a pointer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

also what operating system and what compiler ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>When writing your own operating system, wouldn't you have to incorporate your own way to read GUI?

Not necessarily, if you make it compatable with X11 then you can use most standard *nix GUIs. The GUI is only a method for humans to interact with the monitor and keyboard. It has nothing to do with the operating system itsef.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

MS-Windows tutorial. You need a fundamental knowledge of the C language, c++ will work too, but not required.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to DaniWeb. I'm sure there are lots of people here eager to help you. Just post your questions in the appropriate board.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Look here for an explanation: http://gregs-blog.com/2007/12/10/dot-net-decimal-type-vs-float-type/
Starts with C# ends with C++.

Decimal works only for managed c++ code. Normal c++ has no such data type.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh I see now -- the problem is that you misspelled "namespace".

>>If I`m doing mistakes sorry but I`m still practising English.
Your English is pretty good -- you are doing a good job at it :)

ddanbe commented: RESPECT! You have a fine eye! +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

For money, it might be better to use large integers instead of floats to avoid the rounding errors. Just use an implied decimal point, for example 100 is $1.00 USD. Or you could use two integers, one for cents and the other for whole dollars, but the math would be a little more complicated.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You will never get exact precision with floating point because of the way they are represented in memory.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what compiler and version of compiler are you using? The first header file, stdafx.h, is for Microsoft compilers, and should be surrounded with quotes, not angle brackets #include "stdafx.h"

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since you didn't post any code I can only guess that you failed to include header files and identify the namespace.

#include <iostream>
using namespace std;
...
...
/blabla
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>if(users[userName].name

UserName is std::string, not an int. My guess is that the function need to search the User array for the username, then use that index number in the quoted line.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have not actually worked with file mapping, but I suspect the problem is that std::string attempts to allocate memory which causes the file mapping to crash. Try replacing std::string strData[ 200 ]; with character arrays char strData[200][255] and see if that fixes the problem.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm not completely certain what you are attempting to do, but here is one way to do it. It is not necessary to close the file and reopen it. Just reset the stream back to the beginning of the file, as shown below.

std::string line;
for( ;; ) // infinite loop
{
    while( getline(answer, line) ) // get a line of text
    {
          // do something with this line
    }
    // end of file reached, so now rewind back to the beginning
    // and start all over again
    answer.seekg(0, ios::beg);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't understand your problem. The code you posted works perfectly ok for me. Is there other code you didn't post? If yes, you will probably have to post it all so we can see what is going on.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what's the value of line_start that's on line 7 of the code you posted?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ezzaral commented: I love that site :) +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Two problems:
1) need a return value to return the factorial. Your function does the recursion but doesn't calculate anything.

2) The function's return value should be int, not void.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is one of several ways to do it. Run this little program so you can see what it is doing.

#include <iostream>
#include <sstream>
using namespace std;

int main()
{
    size_t pos;
    string tm = "01:02:03";
    char c;
    int h = 0, m = 0, s = 0;
    stringstream str(tm);
    str >> h >> c >> m >> c >> s;
    cout << h << " " << m << " " << s << "\n";
}

>>Is that the situation where i have to use binary i/o?
No. The c++ fstream class will make that conversion for you, just use the << and >> operators to save/restore the integers

int main()
{
    ifstream in("myfile.txt");
    int n;
    in >> n; // get int from the file
}
vmanes commented: good clear response +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you need to download and install the Windows Platform SDK because that compiler is too old. Get it here. After installing the PSDK in the VC++ 6.0 IDE select Tools->Options->Directories and add the include and lib paths.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If people are too stupid to know that the paperclip is used for attachments, they have no business on a 'IT Discussion Community' IMO.

What makes you think people will automatically know what that paper clip is for? I didn't know what it was for until just now when I read your post because I always scrolled down and hit the "Manage Attachments" button.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't know who did the math, but $25/hour times 2080 hours in a work year is $52K, not 44K.

>>We are not talking bailouts, but loans.
Bailouts for the banks are loans too. "Bailouts" doesn't mean free money with no repayments.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

And they get paid $28USD/hour for doing that! No wonder american cars are so expensive compared to cars from other countries. But hopefully, those guys are the exception.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

http://www.clickondetroit.com/video/10235271/index.html

Now that's what I call productivity at the workplace :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is there a point to this thread?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Obviously Dani doesn't mind or she would have deleted it a long time ago.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Haven't you learned yet to read error messages and fix problems? The first error message ways noOfBooks is not been defined on line 119. Well, what do you think is the problem? If you look at the parameter list you will see its called noOfUsers, which isn't the same. The fix: change the damed thing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Moved. If I put it in the wrong place someone else can move it again.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What the hell are you talking about ?? DC as in Direct Current, or DC as in Washington DC?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>got it pulled from her child's kindergarten Christmas show
OMG CHRISTmas is all about religion. And there is nothing religious about that song.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

double posted here

Salem commented: Thanks for the heads-up +25
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

please explain your code

getch() returns 0 when one of the special keys is pressed, such as one of the Function or arrow keys. When that happens the program has to call getch() again which will return the key code of the key that was pressed. The reason for this behavior is that special keys have the same key codes as other normal keys, and the program needs some way to distinguish them. When I write such programs I normally make those key codes negative values so that the rest of the program can easily distintuish between normal and special keys. Other programmers have added 255 to the value, which works ok too.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

A long long int (signed/unsigned) is 8 bytes. cout<<sizeof(long long)

vmanes was correct -- you said a "long int", not long long.

>>I only have 64 machines so I get 8 byte. (by default).
I'm running 64-bit Vista using VC++ 2008 Express and sizeof(long) is 4 bytes. It probably depends also on the compiler.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

To do that you have to get down to the nitty-gritty with the operating system. The curses library (*nix) or ncurses (MS-Windows) will make that easier for you. For MS-Windows there are several other options depending on the compiler you are using.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yea, go buy one and set it up in your back yard. I wounder if your neighbors will notice :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to DaniWeb. Sorry I had to snip all that information, but rules are rules. You can include some of it in your personal information in your CONTROL PANEL, link at the top of each page.

There are a few of us old farts around here, welcome to the crowd :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
struct sale
{
int *week;
int *units;
int *price;
char *name[30];
}weekly_Sale [13];

   for(i = 0; i < 13; i++)
   {
       scanf("%i %i %i %s", &weekly_Sale[i].week, &weekly_Sale[i].units, &weekly_Sale[i].price, weekly_Sale[i].name);
   }

>>.....would that snippet of code work?
No -- why did you change the structure to use pointers? Put the structure back the way you had it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

George Best, 1973 against Liverpool - classic!

He said "header", not "headliner" :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Have no idea what you are talking about. What is "lsass.ess"? An operating system? application program?

Please post in the correct DaniWeb board. This one is only for intruductions, not questions. Tell me what it is and I'll move it for your.