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

Here's an article about why we don't let just anyone bring anything across our borders. We've had too many problems with people knowingly or unknowingly bringing diseased agriculture products here. And some states do not allow fruits to be brought across state borders. I recall 40 years or so ago my mom and dad took a trip to Arizona and a border guard took her orange she was eating!

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

In America there is the Bill of Rights, or something like that, which makes it very unlikely that a personal computer could be investigated without good reason.

It's the fourth amendment to the us constitution

The right of the people to be secure in their persons,
houses, papers, and effects, against unreasonable searches and
seizures, shall not be violated, and no Warrants shall issue, but
upon probable cause, supported by Oath or affirmation, and
particularly describing the place to be searched, and the persons or things to be seized.

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

I think I have also heard "to snap something" as meaning "to steal something".

That's "to snatch" not "to snap"

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

and originated from verb "to snap"?

"to snap" means to break in half, such as snap a twig (small tree limb). It could also mean to rub the thumb and middle finger together to make a noise -- snap you fingers. People who do those things are not usually called snappers.

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

Replace with NULL to indicate it has no value, assuming the field is allowed to have NULL values.

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

It can be done just as easily like this

#include<stdio.h>
#include<conio.h>

struct reco
{
  char acc[6];
  char pin[5];
  float money;
}log;

int main()
{
 clrscr();

 FILE *rec;

 rec= fopen("rec_log.txt", "w");


 for(int i=1;i<4;i++)
    {
     printf("\n\n Enter Account: ");
     scanf("%s",log.acc);
     fprintf(rec,"\n\n Account no.%d : %s",i, log.acc);
     printf("\n\n Enter Pin: ");
     scanf("%s",log.pin);
     fprintf(rec,"\n\n Pin no.%d : %s",i, log.pin);
     printf("\n\n Money: ");
     scanf("%f",log.money);
     fprintf(rec,"\n\n Money: %f",log.money);
    }

    fclose(rec);

 getch();
}//main
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why are you using an array of reco objects? The array is not needed, just re-use the same instance of reco.

The loop on line 19 is wrong -- arrays are always numbered starting with 0, not 1. In your program valid array numbers are 0, 1, and 2. There is no array element number 3, and that may be why your program crashes.

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

Well Thanks for reply. But that is not the correct solution because the deseired result is not achieved.

Humm -- I answered the question you asked. Don't blaim me if your program doesn't work right after correcting the problem you asked about.

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

You are attempting to set a pointer to a pointer to itself. That makes no sense at all, something like saying "you are your own father".

Note: main must be declared to return an int. c++ does not allow declaring functions without a return type.

You need to do something like this:

int main()
        {
         sample s; // an object of type sample
         sample *e; // a pointer 
         e = &s;    // set pointer to object
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is it also standard to add 1 to tm_mon,

Yes. Both those are well documented "features" of time.h

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

You have to add 1900 to the year.

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

Too bad you waited so long to get help.

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

Interesting, apparently I'll never get cancer :)

The fact that capsaicin and other vanilloids are already commonly found in the diet proves they are safe to eat.

This could make development of a drug containing them a much quicker and cheaper process.

But will the new drugs contain a significantly higher dose of the capsaicin that is found naturally in our foods? If yes, then they still need to do a lot of work testing the effects of higher dosages to the human body. If no, then what do we need these new drugs for? Just eat more spicy foods and save billions of money.

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

I have two cars, one white and one wine. My grandaughter's car is canaru=y yellow.

can't wait to be 16.

It's not all it's cracked up to be. One day you will blink your eyes and you will be 70.

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

Read this Microsoft article which explains what the @ symbol is used for. Too bad C and C++ don't have that.

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

That is correct (link) -- the two most common birthdays are Feb 28 and May 21.

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

line 22: use == operator, not the = assinment operator.

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

Nice advertisement for a program Don probably doesn't want. Next time try posting something useful.

@Don: MS Sql Server accepts several different data formats, here is a list of them.

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

Congratulations! You get all the puppies you want :)

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

verify that app.path returns what you think it does. Also the file can not be open by some other procesas.

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

persistence

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

Don't worry about it -- airport security are just too busy to thoroughly search all the files on everyone's computers. All they want to see is that the computer is indeed a computer by turning it on to make it work. They don't really csre about what's on the computer unless the person's name is on some sort of watch list.

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

As I recall a few years ago (2006) a *nix super computer beat the world chess champion at a game of chess (link). The program could probably not have been accomplished under MS-Windows.

*nix and Unix is so cryptic in both filenames and parameters most likely becuse it was invented by geeks for geeks on mainframe computers. No one in 1969 imagined there would be computers in people's bedrooms that have more processing power and operating systems than the mainframes of 1969. And most certainly it was not originally intended that Unix would be used by every person over 5 years old in the world.

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

Add multithreading. Put line 57 in a tight loop, inside that loop after listen() returns create a new thread. lines 62-110 should be in another function which is the thread code. The newest version of c++ standards includes new standards for creating threads which I have not read or used. You can use either that or the operating system-dependent way of creating threads. Since you didn't say what operating system you are using I can't help you further with that. I'd suggest you use the new c++ standards for creating threads so that your program can be os independent as much as possible.

[edit]Here is a link you might want to read.

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

What operating system? Under MS-Windows see this article. Since we know nothing about your installer we can't tell you how to implement that.

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

No, it should not be <=. If you start counting from 0 then 0, 1, 2, 3 are 4 numbers.

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

post the first few lines of the data file, if small enough just post the whole thing.

if(count < first)

That looks backwards, first is initialized to 0 and count is read from the file. The only way count could be less than first is if the value in the file is a negative number.

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

You need to write a function named pi so that it can calculate pi(x) Or does that mean pi as in the circumference of a circle (3.14...) ? Same with the function ln()

If the array is correctly calculated outputting the result is trivial -- just call printf() in a loop

line 21: make it easy on yourself and put a couple carrage returns in that line, split up the statements instead of putting them all on the same line. For example the following is much easier to read.

if (GET(k)==0)
{
    for(j=2*k+1,i=2*k*(k+1);i<P2;i+=j)
        sieve[i>>5]|=1<<(i&31);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In that case please mark this thread solved.

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

So, what is the problem? You stated the objective of the program but didn't tell us what's wrong with the code you posted.

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

Yes, but the code you posted doesn't match the errors you are getting. How do you expect anyone to help you if you don't post the correct code??? Or maybe you are not compiling the program you think you are compiling, you could be compiling an old version of the program, which happens occasionally (been there and done that.)

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

obvious improvements make Windows 8 a strong contender

The only "improvements" I've seen is boot-time speed, it boots considerably faster probably because the kernel is smaller. Otherwise there is no reason to downgrade from Windows 7 to Windows 8.

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

Type mismatch in parameter '__s1' (wanted 'const char *', got 'int *') in function search()

That makes no sense at all -- search() doesn't take any parameters so how could that error occur??? Don't waste our time by posting nonsense code.

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

did you post the correct code? I don't see a function named search().

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

What is the error?

Line `14 is incorrect -- remove the & pointer operator because character arrays are always passed as pointers.

You can delete line 17 because when the file is opened the file pointer is already at the beginning of the file, unless you use one of the open flags that sets it at the end of the file

line 32: why are you deleting the same character that was just read on line 31??? Move line 32 down outside the loop.

Even after you correct all the above it probably won't work in some cases. What happens if the string it is looking for is "John" but the string in the file is "Johnson"? That case will produce a false positive. A safer solution is to read an entire word from the file then compare the two. Instead of reading the file one character at a time all you have to do is call fscanf(fpcust,"%s", temp); which reads the whole word. Then delete lines 29-33.

delete line 39, no need to flush the stream at that point.

delete line 52, no reason to change the file pointer. The file pointer is already at the next position in the file. And it won't ever get executed anyway because the program will exit immediately after the first comparision due to the previous two exit() function calls.

line 54 will also never be executed for the same reason that line 52 won't.

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

From what I've seen MAC is a pretty lousy operating system, my friend has one that crashes constantly. The more I use Windows 8 the better I like it. Windows 8 boots a lot faster than any previous version. Ubuntu boots even faster, but a lot more difficult to learn and use then Windows. The last time I heard *nix was the best os for servers (out performed Windows). So which is best depends on what you want to do with it.

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

I hope someone shoots the second one so that we taxpayers don't have to spend millions $$$ on trials and imprisonment. But I heard there may be more than two involved in those bombings.

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

i cant use vector and cant pass the size from main function. i just need to complete the median function and submit it

If you can't change that function then the task is not possible. You can't compute the median if you don't know the number of elements in the array. The only other possibility is to make the array size a global variable, but that is a horrible suggestion.

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

Or use std::vector instead of array

henrySh commented: the array has a limited members.....while the vector has unlimited members,so we can add members as we need +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That was a typo -- should have been 8 year-old, not 80-year-old.

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

But can you remember what you had for breakfast yesterday, AD?

That might be a bit of a problem :)

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

What! I remember it like it was yesterday :)

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

Wednesday, Feb 3, 1943, Aquarius. The day I was born four US Army chaplains died on a ship that was struck by German torpedo in the North Atlantic.

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

or the North Koreans trying to get Muslim countries guilty

You give them too much credit -- I doubt that dictator is that smart

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

Their devices were probably wrong. I've only heard about 2, one of them was a young child.

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

I'll write that program or you, after I see you have depposited $1,000.00 USD in my PayPal account.

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

Make sure the coordinates you pass are SCREEN coordinates, not Window coordinates. In full screen mode the two are the same, but not in windowed mode.

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

free() does not change the pointer, it still points to the now-freed strings. Try this

for(index=0;index<50;index++)
    {
        free(report[index].name);
        report[index].name = NULL;
        report[index].score=0;
    }

Also note that NULL refers to pointers, not integers. If you want to initialize an integer to 0 then do that instead of using NULL. Some compilers define NULL like this:#define NULL (char *)0

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

So when my program is launched the global class does not have the data to use

Then I suspect you need to reorginze the logic of your program. Function foo() can't do it's job if the data doesn't exist yet.

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

you're going to have to make searchtype public global so that Form2 can read it.