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

In USA when you get lots of medicare Part B advertisements in the mail (start getting them at about age 64) :)

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

I'm fairly new to Assembly myself, is there a reason something like this wouldn't work?

xchg eax, ebx ; swap Value1 and Value2

That exchanges the two integers in the registers all right, but doesn't save the values in the memory addresses of the two pointers. The results still have to be saved at those addresses. But that xchg instruction isn't needed for the simple swap in this program -- wasted CPU time.

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

That's what I thought. Its a void function. How do you expect cout to print the return value of a function that doesn't return anything???

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

Would you put a link to the Top of the page on the bottom of the page like many web sites do? Its annoying to have to use the scroll bar to scroll back up to the top.

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

>>updateDifference(cashPrice, creditPrice, totalOfDifferences)

What does that function return?

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

You failed to include <iostream> and <string> and the using std::cin; , using std:cout; and using std::string; statements.

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

>>if (nights<='30') && (nights!='0')

Badly formed. You need more parentheses. And a single character can not hold more than one numeric digit, so probably need to test against integers instead of charcters. if ((nights<=30) && (nights!=0))

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

The word "struct" should not have been there because Telem is a typedef name not a structure name.

you create an object of that structure in some other function then pass a pointer to it, just like passing a pointer to an integer that you posted in your original post to this thread. Example:

int readVal(Telem* tm)
{
   // blabla
}

int main()
{
   Telem tm;
   readVariables(&tm);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why would I want to copy and run your program?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
int readVal(struct Telem* tm)
{
  scanf("%d%d%d", &tm->entrytime, &tm->cust_num, &tm->waitime);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The "best" way is debatable -- here is one way.

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

void say_hello()
{
   printf("Hello\n");
}

int main()
{
   for(;;)
   {
       say_hello();
       Sleep(1000*10);
   }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When you know that you will see the cemetery in your mind often

I don't think old people do that any more than you youngsters.

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

Retirement -- go to sleep when I want to, wake up when I want to. No schedules to keep, no one setting unreasonable deadlines. Do what I want when I want.

By the time you are old enough to retire the wold will be a lot different than it is today. How knows but by then people may never grow old.

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

I use IE8 exclusively. I have google chrome installed but don't like it. I've used FF, but dropped it when IE added tabs like FF has. As for speed -- I don't give a dam about a few milliseconds nor do I care about themes or add-ons or writing web applications for all those browers although I know that can be a big pain in the ass to do. All I need is basic browser to surf DaniWeb occasionally.

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

The only way to run Turbo C on Windows 7 is to install DosBox and run it from there. MS-Windows no longer supports that old 16-bit code.

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

The code I posted does not change the pointers, only the values to which they point. If you want to use xor then do so.

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

swapping two integers in assembly is a lot easier than the code you posted. This assumes 32-bit integers on Intel family of 32-bit/64-bit processors

mov esi,x_ptr
mov eax,[esi]
mov edi,y_ptr
mov edx,[edi]
mov [esi],edx
mov [edi],eax
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When all your teachers are dead.

When you go to a 40th class reunion and see nothing but old grey-haired people who have grandchildren and great-grandchildren of their own.

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

Ancient Dragon has already retired.

Yup :) I'll give you one guess as to who voted "Retirement is the best"?

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

That doesn't need a computer program. If you enter the numbers from 1-20, then all of them will be in the range 1-50 and none of them will be in the other ranges you mentioned.

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

Ok, so basically i have to make a new dll that calls all of the old functions then add the new calls, do u happen to have a good tutorial for making dlls? Ty for the help :)

How to create a DLL

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

Student life hell???? HaHaHaHa. Wait until you have to actually work for a living. Your time in college is only the bare beginning.

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

You can't decompile a DLL or *.exe, the most you can hope for is to get its assembly language code.

Let's say the name of the original DLL is A.DLL and you want to write B.DLL. All you have to do is have B.DLL call the functions in A.DLL in the same way that any *.exe will call functions in B.DLL. Ib you have A.LIB that is supplied with A.DLL then the job is easy -- just link B.DLL with A.LIB. If you do not have A.lib then you will have to first call win32 api LoadLibrary() and then GetProcAddress() for each function you want to call in A.DLL.

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

If you want to prevent someone from entering anything other than numeric digits I would get then to enter a string instead of int, then check the string for digits.

char input[255] = {0}; // input buffer
char *ptr;
printf("Enter a number\n");
fgets(input,sizeof(input),stdin); // get keyboard 
// now strip off the trailing '\n' that fgets() add to the end of the string
ptr = strrchr(input,'\n');
if( ptr != NULL)
   *ptr = '\0';
// now check each character for digits. 
// If any non-digits are found then loop 
// back to the top of this code and to it again
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hit the Post Reply button, then delete the number that follows the person's name inside the quote tags.

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

Its not a file -- its a windows registry entry.

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

>>which order we should learn to c++
From the beginning, of course.

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

>>So if you have 1.4 million posts, and 20% of them come from 1 million people
That's an incorrect assumption. 20% of the total post count (200,000) come from the top 35 or so members (see Total Members by Rank link)

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

You need to learn how to use google. If you want c++ ebooks then just google for them.

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

The math still doesn't quite work - 80% of 800,000 is 640,000 - if we take off the million posts supposedly made by 20%, that leaves only 450,000 for the 80% to have made, and that's at today's posting totals. Using today's membership numbers (900,000, 80% = 720,000) the disparity is even greater.
Gosh, something that's not quite right on wikipedia? Who'da thunk it?

What??? The article says 20% of DaniWeb contributed to 1,000,000 posts (I'm assuming that doesn't include deleted spam posts). What are all those other numbers you tossed around? 80% of 900,000 is the estimated number of active members and is a completely different issue. You are mixing apples and oranges.

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

You can use Task Manager to kill the process. Ctrl+Alt+Del will bring up the task manager.

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

>>is VC++ 2010 work without .net framework?

The c++ prograsms it produces do not need .net framework unless it calls functions that require it.

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

Well, the proof is in the pudding. You may be right, but never know until the spam accounts are removed. Of all the new accounts created over the last month how many were spammers? That sample should be easy to determine.

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

>>avg = ass_average(int num_students, int j);

When you call a function you do not put the variable types as part of the parameters. That's only for function prototypes. All you have to do it put the variable names as the parameters, like this

avg = ass_average(num_students, j);

cdn88 commented: Thank you for such a quick replay, that fixed it! +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

dev-c++ is no longer recommended because its ancient, lots of bugs, and no longer supported.

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

I believe that number also includes all the spammers and porn posters and wouldn't be a bit surprised if they account for about half or more the total membership. Maybe Dani should just delete all those accounts and see what happens to the total membership.

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

vc++ 2010 express or Code::Blocks. Both are good C and C++ compilers with good debuggers. I prefer VC++, but for portability between MS-Windows and *nix you might want to do with Code::Blocks.

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

If you already know a little about VB6 and VB.NET then you have probably mastered the basic concepts of variables and loops. You might want to begin learning C and C++, it doesn't matter which one you learn first.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
int* a = new int[4]; // allocate memory for 4 integers
a[0] = GetParentVar1();
a[1] = GetParentVar2();
a[2] = GetParentVar3();
a[3] = GetParentVar4();
return a;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have no idea what a "student information portal" is, but from your description I would start out by coding the structure and unions. The instructions you were given most likely tell you what they should contain.

As for next and previous page, write yourself a little console program that displays the decimal values for those keys. Your program will have to use non-standard C functions and call getch() from conio.h twice because it returns 0 or 224 the first time for special keys and the second call will give you the actual code. These codes are the same as normal keys, so you will have to device some way to tell the difference between normal keys and special keys. One way I've seen that is to add 126 to the special key value, and another way is to make the special key value a negative value.

If you don't want to use non-standard C functions in conio.h then another alternative is to use ncurses library.

#include <stdio.h>
#include <conio.h>
// Main Program 
int main()
{
    while(1)
    {
        int c = _getch();
        if( c == 0 || c == 224)
            c = _getch();
        printf("%d\n", c);
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Nice and interesting article you posted. I don't think I will be around when that happens though.

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

You can compile C code as c++ with no problems. All win32 api functions are C, none of them are pure c++.

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

My system tries to download the file Solar_Life_Cycle.svg. I get the option to either save it or Find a program that knows how to read it. I suppose there must be some program that I need to install that knows how to read it.

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

>> Shouldn't there would be a way to detect uninitialized variable

Maybe there should, but there isn't. There are no invalid values in C or C++ lanauges. And isNULL will not return any valid information because there is no way to detect whether an integer contains valid data or not. You can only guess.

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

>>i want to make a game

So, what's stopping you?

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

Have you studied this tutorial?

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

I doubt two suns would be possible anywhere in the known universe (except in Star Trek). If there were two suns, which one of them would the planet revolve around?

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

er, actually it will end as a white dwarf and slowly fade away - no blaze of glory for us.

What is that link to? My computer (Windows 7) doesn't know what it is.