WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

"If you keep doing what you're doing, you'll keep getting what you're getting. If you keep believing what your believing, you'll keep achieving what you're achieving."
~ The Uncommon Way by David Wolfe

A different way of stating this is

A Definition of Insanity:
Continually doing the same things over and over and expecting different results.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I just hate when someone in the office downloads huge amount of files because the connection starts to slow down.

His wife won't let him download that stuff at home, though.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Why? Doesn't your book do a good job? Or Google?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Your formatting looks much better.

In addition to structures, you are also trying to learn counters, string comparisons, and somewhat difficult logic.

If you want to learn structures, use what you already know. Stop trying to learn it all at once. You should be able to program my suggestion in a short time because you already know input, output, and simple math.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I believe I have to keep track of that decimal. If I converted every decimal to an integer I would lose the placeholder for that "." When inserting it to an array I would simply have 10345 w/ no clue where that "." should go.

storing in an array I'm assuming it should be |_|...|1|0|3|.|4|5|/0|
(the first couple slot of the array were misc spaces).

People need to think rather than react...

Let me expand what I posted:

Assume you have num=103.45
Get rid of the decimal -- num*100, decimal=2

Now assume you have num=221.5
Get rid of the decimal -- num*10, decimal=1

And this time assume you have num=341.236
Get rid of the decimal -- num*1000, decimal=3 decimal is a variable.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

And how well does it work?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Assume you have num=103.45
Get rid of the decimal -- num*100, decimal=2
Now you have a slightly more complex version of integer.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

why not give studying a try

Formatting the code would help, too.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Do not start new threads for the same question.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

To begin with, this is not a code snippet! It is a question!

snipped

Did you just hand the answer to them? After over 1000 posts you should know better than that. We help here. We are not a coding service.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

>> Real Player
http://maps.google.com/maps?q=2601+Elliott+Avenue+Seattle

Nothing particularly interesting about that building, but the area has alot of fun places visit.

True. But when I saw it I was tempted to look inside. I went to Pike's instead. Had a much better, and yummier, time.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

See, I ain't sew dumm...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Completely depends on what you know. Since you gave us no hint (i.e. code) there's not much to explain.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

this is for a C program.. not C++. I posted in here because I was gonna build in C then transform.. so I doubt I can use stringstream.. =/ ugh

If it's a C program, you need to post it in the C Forum. It doesn't matter what you want to do with it later.

I'm trying to convert a double w/ a string of characters w/o using sprintf and padding w/ 0's.. omg... driving me nutz..

what I have thus far..

and what does it do thus far. And what doesn't it do. Don't leave it to us to figure out what it does wrong. Tell us. Then we can look at the code understanding what we are looking for.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Head up to Washington an check out Bill Gate's house, Microsoft, Real Player, Google...

Wait a minute. This is a vacation...

Universal Studios, Disneyland. That's more like it...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

That's pretty much the same with all pre-built computers. I bought a HP Pavillion some time ago and it was like that too.

This I realize. It's why I didn't recommend Toshiba, Gateway, etc. :)

As for disks -- they don't give them to you because you can create your own, at least I was (and did) do that. It took three DVDs and will restore the computer back to factory settings.

But I for one don't want factory settings. I want a clean install without the factory add-on software that I'll never use (AOL comes to mind).

Not that I won't ever get a pre-built unit. They are cheaper. But I know that if there is something extra I need to do with the computer, it means adding it myself or taking it to the shop to get loaded. If that's even possible.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The only thread I got negative, in my honest opinion, are from idiots to put it mildly. And I get down graded? The reputation and power to change reputation is really beyond my ability to understand.

I don't really see your problem. You have 9 positive rep posts and only 2 negative rep posts. That's 82% positive. And 53 total rep points. You must be doing something right. And if you look at the reputation comments, I see 7. All positive.

IMO, the reason your VB post was negged was the statement

No arguments. Mark thread as solved.

I realize it was probably said in fun, but at least 2 people thought you were being a know-it-all, and slamming their choice because you didn't agree.

I see your post here was also negged. Calling people name is not a way to get positive rep. And giving an ultimatum to the community and mods or we all get a one-finger salute does nothing to make us thing better of you. Sorry.

Take what cscgal said to heart -- ignore rep. It really means nothing.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

How can i print 123454321 (on input 5) in a single loop without any conditional statement...???

Is this a joke?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8];

No. You have defined a single character array that hold 8 characters only. You need to expand that idea into and array of arrays. There are a couple ways, you need to do some research.

2)how would i write the code needed to assign strings to each element of the array names from question 1) above? how would i use a loop to ask the user for the name & assign it to the element?

Depends on how you finally implement #1
Since it's exactly 8 strings, a for loop would be the best.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Guys,

Thanks so much for your replies.
It's been six years since I made this newbie post. :)) I'm a bit surprised that someone else is still replying to this. Makes me happy, though.

Doesn't make us happy.

Rhetorical question: With the help of abhimanipal and whgeiger, can you now finish your program? That should give you an idea why we're more annoyed. :icon_wink:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

you can use the "strrev" function to do so.
example strrev(stringname)

If you don't understand the question, don't offer suggestions please.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Read Narue's first post (her second was for us, not you) and attempt to understand what she said.

This is my code and after it i don't know further after strtok..... I use strtok because some says it is useful to it.....

If someone said you should use strtok() and you have no idea how to use strtok() it is far from useful. And in fact that someone IMO was wrong anyway.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

1) Use consistent formatting. See this
2) You should know loops by now, use them.
3) I see no counters -- important is you want to count things
4) I see no comparisons -- also important for obvious (I hope) reasons.

If you don't know about 3&4, you're not ready for this program. Come up with something else to test out structures. Like a simple
Create a structure with 3 or 4 integer elements.
Input 3 or 4 integers into the structure elements.
Add/sub/mult different combinations of the elements and output answers.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Posting bad code badly with no comments is not helpful. Please refrain and stick to asking for help. Or actually, start asking. You need to learn before you can help.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Grrr.....You're lucky I goofed on the rep button...

That's OK. I got your back. With teeth!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

A double post is when the same message gets posted twice. What you did is post more information -- perfectly acceptable. There is no problem making 2 or more posts in a row as long as there is a reason for it.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I use it every time and it works. I also tried the alternate spelling "&&" and still the comparisons are ignored.

In the list here:
http://www.cppreference.com/wiki/operator_precedence
both && and "and" are recognized as valid.

If you wish your code to be understood, you should use the syntax that the rest of the industry uses. Though and is acceptable in that list, && is the accepted way. In fact I've never seen and used until now, which is why I figured you had compile errors.

For standards experts: Are all those "extra" operator designations actually in the standard? If so, C++ seems to be looking more FORTran-like today.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I have been called a stupid poster here , and I wanted to know why ? That's all !!

You have been called nothing. There are 8 other posters in this thread. How can you tell I wasn't talking about one of them? Does the world actually revolve around you? And you didn't even start the thread!

I said "the generic stupid poster's" which means, if you bothered to think rather than feel guilty about your posts,
"Those posters that habitually post question any 2-week student understands, when given help they ask 'how do I do that', or simply say 'do my task for me, I can't be bothered to learn this'". If that's you, I'm sorry*. If that's not you, what are you complaining about?

I added that phrase to make sure no one took my statement personally. It didn't work. I wonder why.

verruckt24 commented: When Einstein said only 2% of the world's people were intelligent, he was sos damn correct. +2
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes we can. Did you read the Member Rules or any of the sticky posts above?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

As long as it's a Public Function, which you have, just add the form name: Call Form1.RemoteCalled()

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

If you understand Salem's idea, do it.

Otherwise, sprintf() will do what you want very simply. You can merge a string with an int

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

TCHAR
As for the other things, my psychic powers are limited today. Must be sunspots.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

padalhan u naman poh aq ng database program s turbo c sa email q ***

1) Put your hands on the proper keys when you start typing.
2) Type full English words, not Gobbledygook
3) If you have nothing to add to this thread, start your own.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I let you in on a secret, don't tell anybody else, I love to eat out in relatively close by Las Vegas.

Oh, I thought you were a car lover :icon_razz:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yeah, when you buy a Dell, they send everything you need with it. And even if they didn't, you can order it from them over the phone or do so online.

I beg to differ. You get what they want to send you. You do get the option of a few Dell-approved upgrades -- like a couple graphic cards, maybe a couple disk drives -- but very limited real options. And you have no choice on some software like AOL and other trial software cluttering up your drive that no sensible person would want.

And you do NOT get OS install disks. You usually get a directory on the HD (taking up space you should be able to use) which is useless if the disk crashes. But you get charged for the entire OS...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You need to keep track of the index yourself. Adter you load A[3] you need to remember that 4 is the next index:

A[idx] = num;
idx++;   // point at next A
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Enough.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Let's hope a prospective employer doesn't see 'your' [the generic stupid poster's] post in that case

Well, may I know the reasons you called me **that** ??

:icon_rolleyes: Paranoid are we? I guess you need to see the definition of generic:
Generic is something that is general, common, or inclusive rather than specific, unique, or selective.

If you still think it's you, check the definition of each word.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Oops sorry,i forgot to mention the error..
So the compiler stated this error
- no matching function for call to 'Queue::enqueue(char[20])
- candidates are: void Queue::enqueue(cosnt Person&)

You passed a character array to enqueue() . But enqueue() is defined to take a Person

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I am running into problem on getting this program done. Its suppose to quiz you on your 2 powers ie(2^2 = 4, 2^22 = 2m, 2^46 = 32t) I've programmed in python for a couple years but a lot of the tricks python lets us have C++ doesn't or I don't know how use them. As far as I've checked C++ doesn't have an append to array.

1) Don't use getch() , it's not standard. Use getline() 2) Append to array? Please be specific. Exactly what are you asking for? Depending, this could be yes or no.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hi..
I suppose to have a programe to read a data from a file and enqueu it to the Queue.
The programme works like a Priority queue whether the ladies queue need to be inserted to queue first before the gentleman...

But i think i need to try first how to actually read the data from the file and put it into Queue before i need to implement the priority ...

Very good choice

Here is what i try to do but it can't works

Why can't it?

Wouldn't it be easier if you told us what makes you think it can't work?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Is and approved in C/C++ comparisons?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
i = 0;
while (enter = !indata.eof() )
{
    indata >> num[i];
    i++;
}

Also, read this about .eof() (which is identical to C's feof()

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

To expand on the cryptic "Dont use gets" statement, see this.

Caveat:
Though I agree wholeheartedly about not using gets() , I would let it go in this and only this program
1) because you declared the arrays as 256
2) this is simply to test the concept of comparing strings
3) after this program you forget you ever heard of gets() Do we have a deal? :icon_wink:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I don't necessarily consider an array to be a data structure, so I read the line into an array. Maybe your instructor does. I suppose you could do it by reading a character at a time and just deal with the character.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

And what's with the mega-indenting? What are you going to do when you have 4 nested loops with IF statements?

4 characters is enough, not 4 tabs:

void countVowels(string a,int& aCont, ,int& eCont,int& iCont, int& oCont, int& uCont)
{
    int nonVowl=0;
    string.str(a)

    for(i=0;i<=string.length();i++)
    {
        switch(string.at(i))
          case 'a':
            aCont++;
            break;
          case 'e':
            eCont++;
            break;
          case 'i': 
            iCont++;
            break;
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I take it you didn't understand what was mentioned in "Member Rules" and the sticky post above "Read Me: Read This Before Posting"

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Thanks. also, is there a better way to print out stuff to allegro besides using textout_ex?

It seems like textout_ex is going to thoroughly p*ss me off seeing as how specific if you have be to make it work.

Wrong attitude. It's specific because it needs to be. Once you understand what it needs it's a no brainer to give it what it wants.

And if not being able to pass char* + int / double in a single function parameter is going to p*ss you off, maybe there's still room in shop class :icon_twisted:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

First, think about how you would normally create and put numbers into an array. How will you know how big to make the array so that it can hold all the numbers you read in? You should probably dynamically allocate the array with the new operation. blah blah blah.

In other words, create an array large enough to hold the data. As you read each value, add it to the array, starting at index 0. Simple as that.