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

there should be only one star for data in function parameters, like this
bool push(Elements **Stack, void *data);

Two stars means pointer to pointer, which is not what you want

bool push(Elements **Stack, void *data)
{
    Elements *elem = new Elements;
    if (!elem)
        return false;
    elem -> data = data;
    elem -> next = *Stack;
    *Stack = elem;
    return true;
}

Now you call the above like this:

char* somedata = "Something";
Elements* head = 0;
push(&head,somedata);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You might want to change the code so that you can enter as many numbers as you want. You don't want to have to change the code every time you want to enter more numbers, or do you?? Maybe you do, but I wouldn't. You can do that by using a while or do loop and ask for the numbers one at a time. Have the loop stop when you enter a specific number, such as -1.

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

You need to put quotes around FirstNumber and no quotes around variable names. Also put spaces where necessary so that FirstNumber and the value of x do not run together.

cout << "FirstNumber " << x << " SecondNumber " ;

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

It's called "burn out". If you work intensly at anything for long periods of time you will get so sick of it you won't want to do it ever again, or at least for awhile. I'm that way with catfish. I grew up on a farm which bordered a river. My parents loved to fish. One summer the fishing was so good we ate fish 3 times a day for months, not because we didn't have other food to eat but because my parents loved it. I got so sick of eating catfish I have not eaten one since then, which was well over 50 years ago. People get that way with computer programming and other occupations too. I've become burned out at specific jobs, but never programming in general.

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

Isn't it interesting that they blame the black out on beyonce?

Yes, it was her fault -- she was REALLY HOT wasn't she :) :)

Quote from Washington Post:

On NBC’s “The Today Show,” Barbara Lippert, editor-at-large at mediapost.com, said she believed the commercial was racist because it was “just saying that black people are happy.”

OMG! Now that's just over the top, can't we even make a commercial depicting people being happy?? Why don't we just ban TV altogether so that won't happen ever again. It's all God's fault, He is just punishing us with happiness for all the gay rights movement. Why otherwise would anyone want to go to Jamaica and have a good time?

<M/> commented: yeah she was +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

getchar() only retrieves one keystroke from the keyboard buffer. When you type something you have to also hit the <Return> key, right? The Return key is put into the keyboard buffer along with the other keys you type. After calling getchar() you need to clear the keyboard buffer of all remaining keys. Unfortunately there is no standard way of doing that.

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

I always like reading and posting on DaniWeb. Just make sure your employer is ok with browsing the web while at work because many employers keep track of what you browse and when.

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

It does not use COM functions

COM is C, not C++. In fact, the entire win32 api (which COM is a part) is C. That doesn't mean you can use c++, just that all win32 api functions have C interface so that they can be called from a variety of programming languages.

After a little testing with that code, I think you are right, it does need to be compiled as c++. I extracted some of the relevant code for FindAFolder(), copied it into a console project then changed the file exten to *.c and it won't compile.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
  1. You need to provide a function prototype for playgame()

  2. Line 43: remove the semicolon at the end of the line.

  3. line 70: you need to provide an else without any conditions to account for cases when the user enters something else.

  4. I think the biggest problem is line 30: an int divided by another int is still an int, not a float. integers have no decimal places, to 1/2 is 0 not 0.5. In order to correct that typecast either the numerator or denominator to float.

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

fgetc() returns int, not char.

The return type is int to accommodate for the special value EOF, which indicates failure:

The while loop should be this so that the rest of the code isn't run when fgetc() returns EOF:
while( (c = fgetc(myfile)) != EOF)

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

what is awful about it? The code you posted is a lot worse :)

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

@Zakkaria: You need to read your textbook or online tutorials about how to use vb.net read text files.

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

can you add strings to resource at runtime?

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

First create a text file that contains a couple names and passwords. You will ultimately need to eencrypt the passwords to prevent people from just using Notepad to read the text file. But you can skip that for now. Then create a loging form with user name and password text boxes. In the Ok button onclick event handler is where you put the code to read the text file and search for user's name then compare passwords.

Here is a thread about encrypting and decryption strings, but you probably won't need that until you get the login form working.

Don't worry about the rest of the problem until you get the above working.

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

post new code please

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

Why not just combine the two functions by setting a default value for the parameter, they are both the same thing anyway

class Date
{
  public:
    Date();
    Date(const int m);
    Date(const int m ,const int d,const int y);
    void Input();
    void Show();
    bool Set(int m,int d,int y);
    bool SetFormat(char f);
    int GetMonth();
    int GetDay();
    int GetYear();
    void Increment(int numDays = 0); // <<<<<<<<<<<<<<<<<
    //void Increment();
    int Compare(const Date& d); 
  private:
    int day;
    int month;
    int year;
    char format;

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

You don't need a hook function to do that. Just call SHBrowseForFolder() function

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

I'm intrigued by Budweiser being the last on the list (

Yes, surprising to me too. Maybe it's because the Bush family doesn't own the company any more. There was a hostile takeover a few years ago (2008). The company hasn't been the same since then.

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

Now that I think about it I don't recall ever seeing a calculator with a backspace. They have a Clear button that erases the entire line so that you can re-enter the entire number.

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

Are you using the browser control? URL is one of it's properties.

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

Case in point, you think ### isn't foul while others most certainly would.

I agree, but historically DaniWeb had allowed language that is also allowed on daytime US TV shows by the big four major brodcasters, NBC, CBS, ABC and Fox and as regulated by US feds. Anyone who considers the word ass as foul language would probably not use the computer very often.

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

Now there are smudges on my notebook (does not have a touch screen).

LOL :)

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

In ANSI-C++, you can use the vargs mechanism. I have not tried this in MS-Managed C++.

Thanks for the suggestion, but CLR/C++ is NOT ANSI C++, and it doesn't support vargs.

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

How can anyone proof someone's age?

They can't. Just have to take the person's word for it. (I suspect adult-only sites do a lot more for obvious reasons.) I know that's reaching a lot, but there isn't much more that they can do. If the mods ever find out that the member is under age they can ban him until he becomes 13. I've seen a couple people admit how old (or young) they are.

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

Yes, I'm working with Raspberry Pi. I thought that was a linux-like distribution, but apparently not. It may gave Debin distribution. I got the Pi as a gift.

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

I think that is the legal limit to join forums without parent/guardian approval. Even at my age I won't tolerate some curse words posted in forums. If they are allowed then I'll leave and not come back. The same with stand-up comedians. People should be able to write a coherent sentence without resorting to foul language.

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

Alternatives are shared memory (via the Clipboard) and memory mapped files.

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

Anyone use this distribution? I have a big big problem with the keyboard -- it misses characters or irradically repeats random characters. I might press a key quickly once and the driver will repeat it 100 or more times. Other times it misses the key altogether.

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

The word a$$ either means anus or donkey,

That may be true, but a "kick-A##" means "very good" or "excellent", but just a little more colorful expression.

Dani's analysis of words that are most likely to be used in an insulting manner

The rule-of-thum was at one time whatever is allowed on daytime TV is ok on DaniWeb, I see that language was removed from the official Rules. I agree with most words in the filter list, but a-s-s?? Yes, I could call someone an a-s-s-hole, but I could just as easily call him a shithead and get away with it.

The reason for starting this thread is to ask Dani to remove the word a** from the list of banned words.

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

I think it odd that I can't post "kick-ass" (such as in kick-ass computer) when shit and damn are ok.

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

I don't buy computers any more, just buy parts and let my son put the parts together to make a computer. I got a kick-ass computer for gaming a few months ago that way so that I can play Diablo 3. And I probably saved about 25% or more over the cost of a ready-made computer of comperable power at Best Buy.

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

You have to change the main() function in Program.cs. In VS 2012 there is a line that says this: Application.Run(new Form1()); Just change Form1 to the name of your login form.

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

It's 25F right now, 6:00 pm. Snowed a little bit yesterday, but almost gone now. At the first sight of snow where I live all traffic stops, interstates (autobahn in Germany) looks like a big parking lot and all schools are closed.

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

I know how to create a function with variable argument list, but how do you create one when the argument type is unknown, something like MyPrintf(...) ? From what I've read CLR/C++ only supports known argument types, such as int,
MyPrintf("...array<Int32>^ arr)

and the calling function

int main()
{
   MyPrintf("One", "two", 3,4);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Multicultrialism has been more successful in USA than in other countries, most likely because that's how USA got started in the first place. I don't intend to say USA is perfect, yes there are a lot of racial issues. But we have been doing this for long time now, since early 1700's. We seem to have had more success than other countries assimilating people from many different cultures.

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

I have mixed emotions about it. What if I don't want the same avatar on all web sites that I visit?

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

Me, not only no but Hell no. My friend got Maya free from his school. I don't know a thing about it, nor do I waste my time using a MAC.

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

May I ask what software is your friend using? I have used Adode Flash on a Mac OS X Leopard (version 10). It's really different from PC version. I have Adobe Flex & Adode flash on a PC but I don't used it often.

Maya.

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

You are right, the free online version just doesn't include a few pages about datagrids and some other topics. In any event it is still a good introduction to vb.net programming.

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

@TnTinMN: I have that ebook, found it very helpful. The free online version doesn't include the chapters about database programming, so he will have to buy the ebook.

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

Do you mean get and set, see this link. If you want read-only, don't incloude the set. If you want write-only don't include the get. Include both if you want read-write.

xHellghostx commented: That works thanks! +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My friend is taking some college courses in computer animation and has to use a mac. It crashes constantly when I attempts to save his work. He would toss his MAC into the garbage can if he didn't have to use it for school.

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

Warning. This YouTube video contains adult language
.

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

how are you catching keystrokes and writing to the window?

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

Why are you checking for KEY_DOWN and KEY_UP? Shouldn't you be checking for the keys that are pressed, such as '1', '2', 'a', 'b', etc. If you have a menu that has three options and you need to enter '1', '2' or '3' then that should check for those values, not KEY_DOWN or KEY_UP.

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

I want to build a house. I already have a hammer. Can you tell me how to build my house?

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

I have a relative who lives in Florida and she doesn't like coming to England because people rarely apologise when they bump into you and are generally rude.

She should go to New York, USA :)

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

Deal, I'll give it to my daughter who already has three.

Toyota Prius (I aleady have one)

<M/> commented: kool +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't get it, what do I get if I say "No deal"? Do I get that car if I say "Deal" ?

For the Lamorghini: No Deal. I don't want it, cost too much in taxes and insurance, and it probably can't pass a gas station,

80 inch television

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

Sorry, BigPaw, but I disagree. I lived in England for three years during 1970s while on active duty in US armed forces. All the English people I met and worked with were very friendly. I didn't preceive any of them as being arrogant, except maybe the royal family, but that is expected (I never met them).