Tight_Coder_Ex 17 Posting Whiz in Training

Google LINUX. There may be a better deliniation of how kernel is realated and/or part of the operating system.

It is, essentially the same (at least for me)

I agree, the destinction is as subtle as car is to transportation.

Tight_Coder_Ex 17 Posting Whiz in Training

Please post errors and warnings. We don't have to study code in that much detail with that information

Tight_Coder_Ex 17 Posting Whiz in Training

im thinkin im gonna have to store the value as a character array and only convert it to actual numbers when i need to manipulate them

Exactly. I've never found the need to do something like this with binary numbers, but before co-processors I coded this kind of thing on the Z80 to give me 128 digit precision in BCD (Binary Coded Decimals).

Tight_Coder_Ex 17 Posting Whiz in Training

There is a file called LIMITS.H that has all the values you are looking for.

Tight_Coder_Ex 17 Posting Whiz in Training

Usually I don't correct and repost code especially for assignments, but because you've got 95% of it right I see no harm. There were only two problems that I've seen that were C++ specific and that is failing to include iostream. Also wrong () and right () were declared as void's but required int's as a return in definition.

In wrong () and right (), breaks are required after each case or it gives you all answers each time it's called.

Also, noticed that rand () % 13 + 1 would return a value of 13 occasionally which is contrary to prompting. A null display in wrong() occured once too. I didn't investigate in detail though.

I've complied this code with VC++ 6.0 and it worked fine. 84 errors first time, but most of those were resolved by include appropriate headers

#include <iostream.h>
#include <stdlib.h>
void right();
void wrong();
int main()
 {
 int a, b, answer, input; 
 cout << "This program will work on your multiplication up to 12\n"
	<< "If you wish to quit, enter -1 to exit this program.\n";
 do 
  {
  a = rand() % 12 + 1;
  b = rand() % 12 + 1;
  answer = a * b;
  cout << "How much is: " << a << " times " << b << "?\n\n";
  cin >> input;
  system("cls");
  cout << endl;
  if (input == answer)
   right();
  else
   {
   do
	{
	if (input == -1)
	 break;
	else
	 wrong();
	 cout << "How much is: …
Tight_Coder_Ex 17 Posting Whiz in Training

I'm not familiar at all with Turbo C++, but maybe check the settings for the compiled application such as machine, stack, heap etc. It could be one of the parameters required by executable header is incorrect.

Tight_Coder_Ex 17 Posting Whiz in Training

The answer is: Dev-C++ by three lengths and a hoof!

Probably just as important if not more so is the text you use to learn the language. I've found

The Waite Group's C++ Primer Plus ISBN 1-57169-162-6

to be fairly comprehensive. Combined with the 1000's of tutorials on forums such as this and news groups, you should be well armed with what you need to learn the language.

Be careful with books though. 2nd 3rd and 4th editions usually come out fairly quick and you will pay the price of the book all over again. Usually there is never enough change in content to make the additional purchases worthwhile.

Tight_Coder_Ex 17 Posting Whiz in Training

There are many solutions to this problem, but I'm going to assume you are not using curses or terminal libraries.


With gdb, break just after the getline (..) statement as see what the input buffer contains and then formulate your code based on that. For example let's say pressing F3 sends a 3 byte combination (EC 7F 03). Then

switch (Buffer [0]) {
case 0xEC:
; Because a function key always has 3 bytes we might assume next is 7F.
if (Buffer [2] == 3) {
; Do whatever is required base on F3 key
}
}

NOTE: This code doesn't represent actual circumstanses but rather how the key combination could be trapped base on this hypothetical situaltion.

Tight_Coder_Ex 17 Posting Whiz in Training

The best
http://www.intel.com/software/products/compilers/cwin/

Good luck.

Well I don't think this kind of rhetoric is appropriate for this or any other forum and I beleive when someone charactizes something as the best it's with the utmost sincerity and should be taken in that context. I have never used Intels compiler, but have taken it upon myself to investigate furthur, based entriely on Intel's opinion.

So Narue, I think you should mabe reconsider your position as self proclaimed officer of etiquette, and as I've noticed with a lot of your posts not be so condesending and critical of what others write.

Tight_Coder_Ex 17 Posting Whiz in Training

I'm enjoying this forum quite a bit. I was curious though, what qualifiies someone as a senior techie. I sure hope it isn't by the number of posts as this is the initial impression I'm getting.

Tight_Coder_Ex 17 Posting Whiz in Training

What exactly are you entering at:

cin >> filename;

If you are not specific (entering drive designator) it will use whatever the default drive is when the application was launched. Probably in your case "c:\".

winbatch is correct with his response, but don't make the mistake of doing the same thing when prompted at the console. Double back slashes have a completely different meaning in that context.

Tight_Coder_Ex 17 Posting Whiz in Training

I don't have a specific answer for your problem other than when diagnosing, don't change so many things at the same time.

Maybe go back to your old system, and if that motherboard has onboard video just use Power, Motherboard, Memory & CPU and then determine if you can get into BIOS settings. Then one by one, start putting everything else in testing as you add each component.

A freind of mine just did the same thing recently and using my method she determined it was the modem that was causing the problem.

Bottom line is each peripheral can adversely affect the system so this is the best method to use.

If your CPU or Memory is toast then a duplicate system that you know is working is sometimes handy. Hopefully the component that is faulty doesn't take out that system too.

Tight_Coder_Ex 17 Posting Whiz in Training

Maybe try C++ Primer Plus, Sams Publishing ISBN 1-57169-162-6. It's a 1000 pages of excelent text with many good examples. I've found the "DUMMIES" series are just money makers and don't have very meanigful content. Most often the most itellegent people assume they are dummies and those books specifically written for them.


Good Luck

Tight_Coder_Ex 17 Posting Whiz in Training

Looks like formatting asm code isn't liked very well. Anyway this is my two bits worth and I've enclosed the executable as a ZIP. Just rename HW.ZIP as HW.EXE and it will work fine.

Is anyone interested in modifying this app so "Hello World", shows as 3D text inside a box only when the left button is being pressed, centered around the cursor and staying inside main window.

I haven't included the windows.inc file as mine is 2300 lines long, so if you attempt to compile you'll just have to supply the required equates, or contact me and I can send you the associated INC file.

Even though this is NOT in PHP code, It does a little better job of displaying than code tags do. :(

CPU P4 
extern _GetMessageA@16, _TranslateMessage@4, _DispatchMessageA@4, _ExitProcess@4
extern _PostQuitMessage@4, _LoadCursorA@8, _RegisterClassExA@4, _GetModuleHandleA@4
extern _GetClientRect@8, _BeginPaint@8, _EndPaint@8, _SetBkMode@8
extern _GetStockObject@4, _InflateRect@12, _GetDC@4, _SelectObject@8
extern _TextOutA@20, _GetCommandLineA@0, _DefWindowProcA@16, _CreateWindowExA@48
TRANSPARENT EQU 1
STYLE EQU WS_SYSMENU | WS_CAPTION | WS_VISIBLE
EX_STYLE EQU WS_EX_STATICEDGE
section .bss
; ============================================================================================
MainWnd resd 1 ; Handle of main window
WndRect resd 4 ; Applications client area
section .data
;=============================================================================================
 
; ùùùùùùùùùùùùùùùùùùùùùù MAIN WINDOW MESSAGE MAP ùùùùùùùùùùùùùùùùùù
MWndM dw WM_DESTROY
dd Quit_Application
dw WM_CREATE
dd WndCreated
dw WM_PAINT
dd PaintWindow
MWSize equ ($ - MWndM) / 6
; ____________________________________________________________________________________________
Wc dd 48 ; cbSize
dd CS_HREDRAW | CS_VREDRAW | CS_OWNDC
dd MainWndProc ; Main window procedure
dd 0, 0 ; cbClsExtra & cbWndExtra
hInst dd 0 ; Instance …
Tight_Coder_Ex 17 Posting Whiz in Training

You are not that far off the mark functionally with what you have, although I wouldn't really consider this a stopwatch program but rather a difference calculator with mulitple outputs.

For example to get start and stop times I would use

cout << "Press Enter to Start:"
time (&StartTime);
count << "Press Enter to Stop:"
time (&EndTime);

I realize that I'm mixing a "C" library with "C++", but the point being is your algorithm can be greatly simplified, and then using strftime you can establish any sort of display you want then.

I assume this is a school project so please give exact specification for a more qualified answer