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

In function RemoveDuplicates(), first find the first instance of the two search strings. Only after that one is found do you want to start removing all other instances. That means you will have two loops in the function, not just one.

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

because sizeof(a)/sizeof(int) produces the right number,

Not in those functions it doesn't. Arrays are always passed as pointers, so sizeof(any array) is the same as sizeof(any pointer) (at least in 32-bit operating systems such as MS-Windows, MS-DOS and *.nix.

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

you wouldn't believe how hard it is for an anglophone to pronounce "Mikael" the french/swedish way, it's like their mouths just can't bend that way.

Yes I would believe it -- most, if not all, Chinese have a really difficult time speaking English for the same reason. I have no clue how to pronounce "Sven", maybe like "seven"???

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

My son was also born in 1964 :)

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 have to submit a C project tomorrow

It's unfortunate you wanted until the last minute to do your homework. I wounder if your teacher will know you didn't write that code?? What you are attempting to do is called plagiarism and not looked upon very kidly by educational institutions.

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

It would be a lot easier if you had written the structure all at one time as a binary file instead of one element at a time as a text file.

fwrite((char *)&chemical, 1,sizeof(database).chrmStore);

Then to read it back just change fwrite to fread

fread((char *)&chemical, 1,sizeof(database).chrmStore);

Now to search for a specific field just put that fread() line in a loop and read the file from beginning to end or until the item you want is found.

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

This code might help you

No it won't, the string contains hex values which atol() doesn't understand. But you can use strtol()

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

I am a FB member but I refused to allow them full access to my account. That's just stupid.

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

@shanki: that link just takes us to the coding challenge -- we can't see the problem unless we begin the challenge. Since it wants to know everything about my FB I declined to take it.

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

First, change the structure by replacing the int data member with a character array to hold the input string.

After you do that replace function parameters that take an integer which is intended to be inserted a node with a character array, for example the second parametr to push() function.

Lines 8 and 10 of the new main() you posted are both incorrect.

Line 8: the second parameter to scanf() should have been str instead of head.

Line 10: There are two parameters to push(). The second one should have been str from line 8. Before you can compile that you have to change push() as I mentioned previously.

Also in your new main() you have to put lines 8 and 10 in a loop so that you can input three strings.

There will most likely be other changes I have not mentioned that you need to make.

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

You might have to read it in as a string the parse it with something like strtok()

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

Yes. Once. the transfer must be register
d with vbulletin.

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

I don't have a problem with my first name -- Melvin, but my friends just call me Mel. There was a period of time when the name Melvin was a joke -- Jerry Lewis made fun of it all the time for a few years.

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

fgetc() only reads one character, you need to put it in a loop to read all the characters in the file. fd normally means "file descriptor" which is usually an integer. Although it doesn't really matter what you call it, fp (file pointer) is more descriptive and in more common use for the return value of fopen().

int c;
while( (c = fgets(fp)) != EOF)
{

    push(&s,c);
}

Replace lines 18-25 with the above code, then delete variable name[] because it isn't used.

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

I want to post an ad to sell my license of vBulletin 4.x in Webmaster Marketplace (at least I think that is where it should go), but it doesn't fit any of the type categories in the dropdown list. How (or where) can I post this?

I have one vBulletin 4.X license I want to sell. Original cost is $180.00, will sell for half price. Deposit $90.00 USD in my PayPal account (send PM and I'll give you the PayPal email to use). After that I will transfer the license into your name (or whoever you specify) as instructed here.

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

Do you know how to read a file? If yes then read the file one character at a time and call push() to add the character to the stack, almost exactly like the code you posted does it from the keyboard. It's just a small change for lines 31-38 of your program.

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

IMHO the only word that needs specific censorship is the F word -- that has to be the worst and over-used word in the English language. I can tolerate all other words but that one. Even though he F word can be used in the same sense that deceptikon mentioned above it just sounds wrrooooong.

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

One way is like this

void foo(int option)
{
    int i =0;
    char *Colstr[] = {"Red","Blue","Green"};
    char *Volstr[] = {"1","2","3","3.5","4","4.5","5"};
    char *Sndstr[] =  {"lo","med","hi","vhi"};
    int numSTrings[] = {3,7,4};

    char **arrayOfarrays[] = {Colstr,Volstr,Sndstr}; // How should this be declared?

      for(i=0;i<numSTrings[option];i++)
            printf("%s\n", ????);                   // How should arrayOfarrays be referred?
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I hope you don't get mad or anything but what year did you graduate?

1962, Alleman, Iowa (for those who are not familar with us geography, Iowa is about in the middle of the country.) My son also graduated from the same high school and had one of the same teachers that I had.

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

Works in Community Center for me using Chrome.

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

My best achievement? I graduated.

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

You need to post the code you wrote. Just telling us is next to useless. Also tell us what compiler and operating system you are using. As a rule-of-thum you need to check spelling and capitalization very carefully. Foo() is not the same as foo().

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

You could change the c++ program to recognize command-line parameter so that the csv file could be located anywhere.

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

Process.Start(@"C:\project\DataTreatment\DataTreatment\DataTreatment.exe");

What's that @ symbol doing there? Is that just a typo or is that really in your program? Also the \ needs to be \\, like this (There needs to be 4 of them in order for 2 to show up in this editor)

Process.Start("C:\\project\\DataTreatment\\DataTreatment\\DataTreatment.exe");

Can you reproduce the problem with a very small C# program that does nothing have that line in main()?

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

Oh! so it does -- good going Dani :) :)

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

I'm confused -- I don't see any changes of the menus (in Chrome anyway). Is this about dockable menus?

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

How well do you know C# (or any other language)?

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

Do you know SQL (Structured Query Language)? If not, then you need to read a tutorial -- there are lots of free tutorials, just google for them.

If you already know SQL, then use CREATE DATABASE sql command. Here is a basic outline of how to do that.

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

Is the csv file in the same folder as the *.exe you are trying to run? If not then you need to tell the *.exe program where to find the folder. You might have to make a slight change to the c++ program then recompile, for example you could allow for a command-line argument that has the full path to the csv file.

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

Start by googling for "c++ antivirus" and reading the links, sometimes google helps and sometimes not, but you won't know until you do it.

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

I think you mean you want to know how to create a date class. Do you know how to create a class of any type? The three items you listed could be methods of the class. The data objects of a date class would contain day, month and year integers, as you might expect.

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

lIne 12: you shouldn't need to delete the streamwriter -- normal garbage collection will take care of that for you. Delete lines 8-14.

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

You also loose your sense of taste and smell. As for expensive -- they were $0.10 per pack when I started. I could buy almost 6 cartons for the price of one pack today.

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

I stopped smoking in 2001, started when I was about 16 or so. I was chain smoker for quite a few years.

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

Or if you use windows and just write standard c++ use the win32 console functions., which I think he's already using.

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

@boris: The code snippet you just posted is whatt I was talking about -- that is System.IO, not ofstream as you tried to use in your original post.

As for appending: see this article

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

Granted -- you were eaten by a big bear.

I wish I had a nice dog.

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

Why are you using ofstream in a CLR/C++ .NET program? CLR/C++ is a MANAGED program and ofstream is UNMANAGED. The two are not compatible.

You should be using System.IO.file streams.