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

1. initialiseBoard() is writing out-of-bounds in that matrix because those two loops are executing 1 too many times. Replace <= with just <

2. delete line 31.

3. delete line 95. the array is never referenced in that function.

I don't know how you will test any of the rest of the code because none of the functions are ever called. You need to add a little code for options a and b to call the other functions.

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

The reason I said its cheaper to keep them alive is because of all the legal fees required to appeal the death sentence -- automatic appeal I might add. The lawyers can be haggling for 20 years or more, costing tax payers millions of $$$. Here is a study done in the USA about 10 years ago.

From this; the cost of keeping a 25-year-old inmate for 50 years at present amounts to $805,000. Assuming 75 years as an average life span, the $805,000 figure would be the cost of life in prison. So roughly it's costing us $2 million more to execute someone than it would cost to keep them in jail for life

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

I want some advise. Is it necessary to be a mathmatician to be a programmer.

You don't need to be a mathematician unless of course you work for a company like NASA. But you do need to know college algebra and trig. Never needed anything else in over 25 years programming.

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

last meal for condemned criminals, waste of food...
In fact any expense on their behalf is wasted.

Arrest them at dawn, convict them at noon, deny their appeal at dusk, and hang them next dawn.

Are you sure you're not American? I though we were the only ones who thought like that.:)

But more seriously, I think we should abolish the death penalty because (1) its cheaper to keep them alive, (2) the punishment lasts longer, and (3) too many innocent people have been put to death. We can always let someone out of prison who was innocent of the crime, but we can't bring him back to life.

Aia commented: I agreed with you +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you probably want to create a structure to hold the data for each customer so that the values will not disappear on each iteration of the do-loop. Then you will need an array or a linked list of those structures. After entering the account number search the array or list for the structure that contains that account number. If found then adjust the members of the structure with the values you enter in the do-loop. If the structure is not in the list, fill out a new structure and add it to the array or list.

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

>Because this thread was made for anything and everything. That's why.
Then I guess it's pointless to have a chat room if everyone refuses to use it.

Maybe because nobody knows its there -- this is the first I heard of it. I probably wouldn't use it anyway even if I had because I just don't visit chatrooms.

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

I know.
Do you really not like either of them?

That's correct. I watched the first epesode of them and have not watched either again. Probably just an old fart thing. :)

May I take this opportunity to point out a few other treats from "over the pond" to our American members? OK, great....

1. Phoenix Nights: It's difficult to make Oldham famous, but Peter Kay managed it.

2. Peep Show: It's like a first person shooter, but with no guns and those guys who are in the Apple adverts (Mapin and Webb).

3. The Mighty Boosh: bit hard to explain really....

Steven.

I've never seen them. Maybe I need to watch BBC America more often, but I think that channel only runs old shows.

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

>>is that reasonable enough for a noob to program in that prob

Depends. Was you hired to be a c/c++ programmer? Did you lie to your employer and tell him you already knew the c++ language? Or did he already know you were a java programmer who needs to learn c++ ?

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

The value 0xcccccc usually is an uninitialized or bad variable. Its not likely that its the compiler difference, but, if the control is a licensed control then I suspect because the DLL was not installed properly on your computer. If that's not the case then I have no idea about the problem.

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

>>is this the right way?
No because atoi() takes a pointer to a null-terminated string and your variable temp is just a single character.

The quickest way is to simply subtract the ascii value of '0' from it like this: int n = temp - '0'; . Why does that work? Its because a char is a small integer and if you look at an ascii chart you will see that all characters have an ascii numerical value. Internally, programs know nothing at all about characters, only numeric values as shown in that ascii chart.

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

That is a reference to a nodeptr object in another function. The object is passed by reference so that InsertListOrder() can change its value. Any changes to Head in funciton InsertListOrder will be made to the object in the function that calls InsertListOrder().

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

C language does not recognize inline assembly instructions like that. The way to do inline assembly depends on the compiler you are using. For example, Microsoft compilers are like this:

#include <windows.h>
int main()
{
   _asm
   {
        // put assembly code here
    xor edx, edx         ; Avoids NULL byte
    push edx             ; MsgBox type
    push edx             ; MsgBox body
    push edx             ; MsgBox caption
    push edx             ; Owner hWnd
     lea eax, MessageBox  ; Addr of MessageBox, USER32 should be    loaded
    call eax   
    }
 
   return 0;
}

>>Not really.... It was the same on my computer every time it was run, and it's also the same address on my friend's computer.

You were just lucky. Don't count on that behavior.

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

Yeah i agree with you OP, lets get "back to primitive"...

Yea, right. Pull the plug on your home electricity and see how long you'll last without a computer:) I hate it when the power goes out during a storm. And if you want the return to the "good-old-days" you have to also take the bad with the good, more disease, earlier death, plague, unsanitary conditions, child labor, and the list is a really really long one.

Nope -- I'll live in today's world despite all its flaws.

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

moved

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

and as always you Americans butcher classics. .

You have that right:D Hollywood loves to take a great film or series and modernize it. Two examples: Dr Who and Godzilla, both horrible remakes.

As for the poll: Christina left out a category -- neither

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

50 characters for a directory name isn't enough space. What if I copy/paste a path that is more than 50 characters? You need at least 255 characters.

line 23: that does nothing. Delete that line.

line 43: ditto -- nothing more than a do-nothing line.

Now for your question: On line 38 you need to re-initilize the variable destination with the text "cp ". just use strcpy() for that strcpy(destination,"cp "); I think that will fix the problem.

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

remove the "\n"s -- that is only for cout. Not allowed to have literals (text in quotes) on the cin line.

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

what are the errors ? Your sizeOf function doesn't work because it will always return 1. The standard C/C++ sizeof() is an operator not a function and evaluates the object at compile time, not runtime. To my knowledge there is no way to duplicate it in C. In C++ I suppose you could write a template that would return the size of the object.

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

what is all that crap? If you want to display a MS-Windows message box why not just call it directly ?

>>mov eax, 0x7E45058A
how do you know that's the address of message box function? The address may change every time the program is run.

>>Not working. Could anybody give me a hand?
Yes -- don't do that. include windows.h and call message box just like every other normal programmer.

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

I have no idea. You'd have to ask them for clarification and help.

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

Optimization is implied, especially for procedural programming. No-one will write 10 lines of code of they can write one.

And i agree, my lecturers gave silly exercises out, and you werent allowed to use the standard methods that you'd normally do.
Pain in the butt if you ask me.

I agree that nobody would write a program in the real world like that, or they shouldn't anyway. But college is not even close to being the real world. So who knows what the instructor wants:)

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

We provide read-only CVS access to our repository. Note that this gives you "bleeding edge" code that may not even compile!

I think that says it all.

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

you don't need function moreToRead() Change lines 27-31 to be something like this:

while( getline(in,line) )
{
   // blabla
}

What format is the file? FirstName LastName <scores> ?

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

Well are you going to design a for loop to loop through and output chars each time? or just call one function to do it. I think we all know which is the most appropriate.

Re-read the original question -- does not say anything about which method is the most effective or requires the least coding. Actually fwrite() will work as well. I think teachers in college ask silly questions like this one just to see if the student has any imaginagion.

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

Is this what you downloaded ? And did you also get the GiNaC C++ library which they provided the link to ?

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

use putc() in a loop to display each character one at a time.

Sulley's Boo commented: =') +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>but idk how to get the file and store it

don't know -- you will probably have to ask your teacher. Saving the file is easy but depends on whether you are writing a C or C++ program, which you failed to answer. I can only presume your program already has the data for the find in memory, or its in another file somewhere. But you need to get clarification from the instructions (please post them) or from your teacher.

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

I think you may have misunderstood the assignment. Are you supposed to ask for the information to be put into the file? The name of the file? or both?

Is this a C or C++ program? What compiler and operating system?

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

See this tutorial. I suspect your problem is in the *.rc file.

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

Planet Size Comparison - A Must See

I had never seen that -- and am awe struck :cool:

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

My contention is that teens aren't bad drivers, but they are inexperienced drivers. The sad truth statistically is that the largest amount of teen deaths is because of automobile accidents, and most of these accidents are related to speeding.

That makes anyone a bad driver. A good driver will rarely, if ever, have accidents. Although here in St Louis a teen is more likely to get killed with a gun then with a car.

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

also delete line 12, don't have to declare that only once at the top of the program and after the includes.

>>How do I make it execute the function once then return to ask if there is another amount

move lines 17 and 18 up above line 15. Also, there is no need to make sales a global variable. Move line 3 to be local to main() then pass it as a parameter to salesInput() function.

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

remove the semicolon at the end of line 13. That's a common mistake for even old-timers -- you just need to learn how to recognize the error.

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

That error message seems pretty clear to me -- it means that your compiler can not compile that program because it contains code that is no longer supported. You will have to use an older Borland compiler, such as Turbo C.

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

Its way too late for you to change majors now -- finish your business degree. After that you can get either another bachelors or a masters, or just get a job in IT.

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

strtoul() will convert a string of binary digits to decimal, something line atoi(). Then if you want to print hex in a file use the "%x" format

int n = 0;
char ptr = 0;
char bin[] = "01010101";
 
n = strtoul(bin, &ptr, 2);
printf("%x", n);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

strtok() is not what you want. The text in string2 may or may not be a complete word surrounded with spaces. It could be a few letters of some larger word. Better if you just search string1 for the first character of string2. When (and if) found check if the rest of the characters in string2 follow. If not, then continue searching string1 for first character in string2.

If you know pointers then the job is a little easier. If not then you can use loop counters to index into the two strings.

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

you can use strtoul() to convert a string of binary digits to hex or decimal.

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

line 31: why is it looping 256 times? There are normally only 8 bits in a byte. should use CHAR_BIT macro from limits.h

I think you need to make the conversion in memory then write it out to the file after all shifting is complete.

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

>>I think I have to change shift function but I couldnt
what's wrong with it?

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

change the format string in line 34 to "%x" and it will print hex instead of decimal digits.

fprintf[B]([/B]ptr,"%X ",shift[B]([/B]r[B]))[/B];
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Wasn't difficult to find -- get it here

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

Just a few (not all-inclusive) changes you might have to make:

If your 16-bit program is using segmented pointer stuff you will probably have to recode that. Inline assembly code that contains interrupts (such as int 21) is not allowed, inp and outp are not allowed. Installation of interrupt handlers will have to be changed.

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

>>my compiler isnt really letting me draw the board it keeps on insisiting that i have invalid types of data

Post your code -- my eyes are not good enough to see your monitor.

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

Your function should return an int, not void. If you want the default windows message handler to also process the message then your function should return 1. Otherwise if you do NOT want this to happen your function should return 0. See here.

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

Is ancient dragon really that old !!??!!
I would never have guessed...

I thought everyone knew it by now -- I've never hidden that. But I'm only 20-something at heart:)

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

Here is one way to get a list of all running processes. That gives you the PID of each process.

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

The 20s to 50s -- not because of any war but because that's when all the big-bands played and big loooong movies that had casts of thousands were made (such as directed by Cecil B. DeMille), and the vaudeville era.

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

>>i don`t know if this is the right forum for this
you are right -- this is the wrong form.

could probably also save the pictures as a blob, but changing the original picture won't change the copy in the database like OLE objects do.

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

The goal is that they will aid navigation because, at a glance, you could see exactly where on the site you are.

I don't think it meets that goal because I doubt very few people will bother to memorize the color scheme. Looks great anyway. :*