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

Her name was Terry. I was 4 at the time and she was about the same age, she lived next door in Des Moines, Iowa. The last time I saw her was when I was 9, my parents moved onto a farm 20 miles away. As an adult I married my first love, we met in 8th grade.

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

It's unfortunate you are being forced to learn something that has been obsolete for nearly 20 years now. The problem you posted brings back a lot of fond memories of how we programmed in the late 1980s and 1990s.

Compare and contrast various memory models with reference to pointer allocation and deallocation especially when multidimensional arrays are to be declared using pointers

There is no difference. malloc() and free() are the same regardless of what memory model is used. And there is no difference in how multideminsional arrays are constructed. If you just state in a program
char* pointer The compiler will adjust the size of the pointer to the memory model being used. you can change that default behavior by using either the NEAR or FAR attribute, such as char FAR* pointer. In this case it will be a 32-bit pointer and the data reside anywhere within the 640K memory limitation. If you specify char NEAR* pointer the pointer will be a 16-bit pointer and the data to which it references will be expected to be in the same segment as the code segment (code and data reside in the same 64K segment of memory which is at most 16K).

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

If you know the index number for testscores[] then just use the same number for the string array. For example consider this code snippet

int highest = GetHightest(...); // where ... are the parameters

cout << "Highest is " << testscores[highest];
cout << "month is " << months[highest];
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

According to this, MS-Windows no longer supports blinking text.

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

That assumes, of course, you know the HWND handle of the window to be restored. If you don't already know it then you can find it by calling EnumWindows()

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

If you are going to plagerize someone else's program then at least change the function names so that people will think you write it for your homework assignment.

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

Nice piece of science fiction. Do you beleve everything you read on the internet? That first link presented not one schred of evidence to prove the allegations. I'm not saying they are false, just unfounded and unproven. I could have written that fairy tail too.

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

I look at the elements of list, list[0] is empty, list[1] and list[2] have something in it, and list[3] is invalid.

If num_elements == 2 then attempting to peek at elements other than 0 and 1 is looking beyond the end of the allocated memory. You can do that, but what you will see is some random values that just happen to be in those memory locations. list[3] is shown as invalid quite possibly because the memory at that location is not owned by the process. just because the debugger shows something in list[??] doesn't mean it's valid memory. This has been the cause of countless debugging hours for millions of C programmers.

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

What part of that assignment do you need help with? Do you know how to create a class? Do you even know what a class is? If not then you should read your textbook about them.

class Hangman
{
public:
    // put the public methods here

private:
    // put the data items here
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I gave up on trying to learn web design -- too boring. I like something that gives me a challenge, like c and c++.

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

Similar to Reagan's people convincing Iran to hold on to the hostages until after the election.

Proof??? This is the first time I heard that conspiracy theory.

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

which were close to ending the Vietnam War in fall 1968.

We all know that "close" is next to meaningless in politics and peace negotiations.

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

they work for me. maybe the problem is your internet provider, or the country in which you live has blocked them for one reason or another.

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

A war that went on much longer than necessary thanks to Nixon's behind the scenes antics in order to defeat Johnson.

You had a lapse in memory maybe? Nixon never defeated Johnson because Johnson didn't run for a second term.

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

The last US census was rigged to create a massive bias towards left leaning states ... To achieve this illegal aliens were counted as citizens, among other things, in several states.

Well, that may be your spin on that, the truth is that they are counted as a matter of 1980 US law.

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

Some concepts take awhile to get straight in your head, pointers are difficult concept for many people. Here is a tutorial you might try. If there are parts of it you don't understand then you should post your questions.

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

I have no toolbar,

You mean you don't see the purple ribbon just above the editor? If not then post in DaniWeb Community Feedback so that someone can help you with that problem.

I would like this to be in C but not in C++.

Why did you post this in the c++ forum instead of the C forum??

How do I define a typedef struct in function f1() and pass a pointer to function f2() without a global definition of the struct.

You don't. The typedef will be local to only the function in which it appears. Other functions can't see it which is why it needs to be global.

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

Her legacy will be that Independence for Scotland and Wales will be a reality decades before it would have been otherwise. I

And is that a bad thing?

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

And the Republicans, after gerrymandering their way into a congressional majority have proposed changing the rules for the Electoral College to get a lock on that as well.

I don't worry about that, over the past 200 years there have been more than 700 proposals to change it, none of them succeeded. (link)

Reverend Jim commented: Cool new avatar. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Of course, it also helps if you can get your rich buddies to give you millions for advertising and if you rearrange the voting districts in your favour.

It doesn't work like that in UK (I know nothing about how they arrange voting discricts, or even if they have such a thing.) Voters don't vote for the PM, they vote for party members who, in turn, vote for the leader of the party. Then the Queen asks the leader to form a government. The process in US is similar, except for the Queen part.k We don't directly elect the President either, but vote for "electors" in November who in turn vote for the President in January the following year.

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

If she was such a terrible human being why was she elected at least 2 times and served for over 10 years? Apparently someone liked her.

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

Read an online tutorial that teaches you how to read text files. Once you understand how to do that the rest is simple (just add each line to the list box)

Maligui commented: Teaching them how to fish. Nice work. :) +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i have seen people submitted in C and C++ too. dont know how?

Huh? That's confusing???

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

There is a fine line between respecting the departed for the sake of their family and loved ones, and creating an unfairly glorified picture of a person just because they passed away.

Tony Blair was interviewed on CNN a day or so after Margret Thatcher died, he couldn't say enough good things about her. But he looked as if he wanted to bite his toung off when saying some of those things.

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

Congress is not going to change that loophole either. They aren't going to make people do background checks to privately sell a weapon to someone else. I saw that issue discussed on CNN a while back.

How much safer were these children because the family had more guns?

No amount of gun laws are going to prevent those tradegies. The only possible way to do so is to disarm America, and that will happen when Hell freezes over. Americans are not about to give up their guns for any one or any government. Just try and there will be a huge blood bath.

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

Humm, never knew about that one. IMO just as easy, or even easier, to click the Submit button.

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

Testing

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

until now Baltic Sea is full of mines and (even) chemical weapons, left by Germans.

I was in Baltic Sea just a few years ago (maybe 10 years ago) on a USA flag fising factory ship doing some work for the company I worked for. We were about 200 miles from Alaska shore, no one mentioned mines in the water. Perhaps they are just on the Russian side of the sea???

@AD, you must have been a pretty young father when you had him

I was 21, my wife and I had been married almost 2 years. We stayed married until she passed after 49 years, 1 month and 11 days.

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

What shortcuts? Didn't know DaniWeb had any in the editor other than copy (Ctrl+C)/paste (ctrl+V). Those work ok in Chrome.

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

Unless you buy the weapon at a gun show

What's why I said "almost"

Kaufman County District Attorney Mike McLelland and his wife, Cynthia were murdered in their home

That unfortunate incident could have happened anyway. But there are lots more where armed women have shot and killed an assiliant (I like stories with a happy ending).

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

we as a family could not afford to go on vacation some years, while a family on social security flew out to Spain or Italy 3 times a year for a 2-3 week stay in a luxury resort?

So what? Maybe that person on social security wanted intil he/she was 65+ years old in order to afford taking that vacation. Don't you think he/she disserved it? I'm on social security and I resent your impression that we old people have not worked for 50+ years to get where we are today.

There are a few people drawing social security who don't need it, the really wealthy such as Senitor John McCain. I think congress will eventually stop that for wealthy people.

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

Automobiles serve a much more useful purpose and are much more heavily regulated than guns. Would you agree that regulating and tracking guns to the same extent would be a good idea?

To my knowledge guns are already more heavily regulated than driver's licenses. In USA you (almost always) have to have a police background check in order to buy guns, that's not true of driver's licenses. And just like guns in the hands of criminals there are a lot of people driving around without driver's license.

We just had two innocent people in my city killed by criminals supposedly taking potshots at each other.

That happens all too often here in St Louis MO too. Bullets penetrate the walls of houses to kill a small child watching TV. Other than that, I don't care if criminals shoot each other. Gangs are big in St Louis, which makes St Louis one of the most dangerous cities in the USA.

So your argument is "criminals don't obey the laws anyway so why bother".

No, that's not the point. Police have to have the laws in order to make arrests, can't arrest someone for doing something that is not illegal. Just don't expect criminals to pay any attention to the laws. Making a law to ban knives is not going to stop anyone from buying a knife.

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

I think you missed the point -- there may be multiple nodes that have the same data strings, so the loop needs to run though the entire list in order to find and remove them all except the first one found.

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

Cyprus sounds like a great place to live! Something like the small farming-community town I live in, population about 2500. The most crime we have had in many years is kids playing pranks on holloween night. My wife grew up in a town even better with population of 350. Everyone was related to everyone else in that town.

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

We only found out about Dave because another member who knew him personally told us. No one is asking anyone at DaniWeb to periodically search world-wide death records for all 1,000,000+ members, that would be just stupid. A memorial account for known people is a good idea.

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

That's hardly what one could call a valid source of information. How many of those were reported multiple times for the same death? No way to know because anyone can report deaths via twitter!! Since when did twitter become an authority source for anything?

Even if it were true (which I doubt), how many more deaths have occured buy automobile accidents? Or by other causes? Am I alarmed at 3530 gun deaths? Hell no. We in us need more guns, not fewer.

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

Yes, Mike, that is what I mean.

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

But, apparently, it also literally means "who is like God", which is even more awesome! We're pre-destined for greatness!

I thought you are atheist, so that should mean nothing to you. On the otherhand, if you mean like greek gods, that's a different story altogether :)

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

If you don't want to, or can't, change the file format as I suggested then the alternative is to call fgets() to read the entire line, then call strtok() to split the line into individual tokens so that they can be stored in the structures, or used for something else. You have to be careful using strtok() because it replaces the tokens with '\0' characters, making the original string useless. So if you need the original string contents then you need to duplicate it before calling strtok() the first time. If the code below the original string isn't needed

FILE* fp = fopen("Chemical_Database.txt","r");
char line[100];

// The following will read each line of the file 
// until there are no more lines in the file
while( fget(line, sizeof(line), fp) != NULL)
{
    char* ptr = strtok(line,",");
    strcpy(chemical.basic_info.antidote, ptr);
    // repeat the next two line for each item in the line
    ptr = strtok(NULL,",");
    strcpy(chemical.basic_info.formulae, ptr);
    // etc etc
    // Now do something with the structure
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Shouldn't his account be retired? He passed away a couple years ago, I think it's time for DaniWeb to retire his account and move on. I see his name in such places as Endorsements, which don't really mean anything for him any more.