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

Use the manual for Borland 4.5 for the commands you need. Not the web.

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

> Font/table size on the forum thread listings is still huge.
Large, but not huge ;) This is by design and I currently don't have any plans on changing this one. Sorry!!

Please explain your reasoning, since us users consider it huge. We are at a loss trying to understand why the font must be so large. Maybe some insight would ease our minds...

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

Use the curlys.

An alternate of version 1, and the format I prefer:

while(1) 
{
    if(1) 
    {
        i++;
    }
}

I personally find that in your original style I tend to loose the {, but in this version the block is visually better defined. Again, my preference. Both work just as well.

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

I'm actually quite interested in a robust method if you don't mind. I want to build good habits as a programmer.

Good habits as a programmer start with understanding the functions you are using and using them properly to get the results you want -- not by searching for a function that does exactly what you wish.

The most robust method is processing each key individually and doing exactly what you need to do with each character entered.

I want people running this program in a Windows C compiler to be able to see the output before their window closes, so I added the line "std::cin.get();" before "return 0;", but now I receive the error message:

Isn't that C++? Why would you add a C++ function to a C program? And one that is identical to getchar() too?

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

Of course you need help. Isn't that obvious?

But you need to give a very specific set of guidelines about exactly what you need. What "algorithms"?

Based on your almost description above, check each character input and create variables for num1 , num2 , and operation . Then test the operation and perform it on the two numbers.

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

Change number to long and see what happens

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

First let me say, please don't post code back all fixed. If you see where the error is, just tell me where it is and I will look to find it. Thanks, much appreciated!

Where what is? Don't you think it would be helpful to tell us what we're looking for?

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

Can anyone help me with my code?!

I need to do a programm binary to decimal converter without using library, just stdio.h

my code works wrong

It does? Think it might be helpful to explain what it does wrong?

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

Is there a way to delete the thread???

No

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

Help with what? You need to explain whatever problem you are having.

You also need to format your code because, as posted, it's unreadable.

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

Convert the first 2 characters (0 & 1) into an integer
Convert the next 2 characters (2 & 3) into an integer
etc.

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

Do what abhimanipal said.

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

Except for using feof() (see this) the code looks fine. More info is needed.

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


(STDIO HEADER)
scanf( const char * format, ... )

string mystring;
scanf("%s", mystring);

Not a valid solution -- unless you want the ability to crash at will. See this. And since when does scanf() work on C++ Strings?

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

What sort of program i should write?

How about a C++ program that reads a line, pulls out the data you want, and outputs that data?

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

Hi all,
I am trying to conver string to decimal.
the sting is 8 byte long and contains data as hex nembers e.g
0000000000000D72

i want to conver this data into decimal as 3442

i'm not getting how to do this
help me...

How do you do it with pen and paper? Explain the process here and we can help you convert the process into code.

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

Hello,
I am trying to make a program which will sort a array of 10 elements using bubble sort. I searce dthe forum and google but douldnt find a problem similar to mine.

You're kidding, right? No one site that explained how the Bubble Sort works sorted numbers? I think you need to search again. Try searching for "Bubble Sort". The first 5 hits show exactly your stated problem.

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

Okay WaltP. The reason you are not retrieving any possible error that has been raised is because of your code and error handling. Please see comments I made to your code below...

mkError:

'and here you say the same thing to the system, disable error handler
On Error GoTo 0

'which of course resets the error object and thus you don't return anything when you 
'do encounter an error (ALSO: Concatination of strings in VB6.0 uses the & character)
Text1.Text = Str(Err.LastDllError) + " "
Text1.Text = Text1.Text + Str(Err.Number) + " "

DOH!!! That makes sense...

Thanks, VB

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

I've been trying to find out the error returned from MkDir to no avail. Err.Number is 0 and I can't find any other error mechanisms available.

On Error GoTo mkError
    MkDir txtDir(Index).Text
    On Error GoTo 0
    Exit Sub

mkError:
    On Error GoTo 0
    Text1.Text = Str(Err.LastDllError) + " "
    Text1.Text = Text1.Text + Str(Err.Number) + " "

I need to know if I get a 75 (path exists) or 76 (path not created) error. Where is this error returned?

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

Since no one has yet even touched on the command line, see this

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

Dani told us that it's all the way down there on purpose so that new posters first read the topic titles while they're scrolling down.

Lame reasoning. Why would I read post titles when all I want to do is post a new thread? That's like reading the License Agreement before clicking "I accept the Agreement". It's hardly ever going to happen.

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

In f2c(), 5/9 = 0. In c2f(), 9/5 = 1. Remember the limits of integer math...

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

Ask the author for a copy of the source.

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

thanks man
the problem is, i didn't fully understand the requirements
can you at least help me understand the question properly?

Such as? We don't understand what you are having trouble understanding if you don't tell us. What do you understand, and what don't you understand?

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

It looks like the only thing you need to do is give the array marks a size and you should be good to go.

You do not need vectors. You do not need malloc().

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

Because every time a word from array1 does not match a word int array3, it's added to array3.

So, if you have 4 words in array3, and the current word in array1 matches none of the words, the word will be added 4 times to array3. You now have 8 words in the array.

Look closer at how your loop and IF statements works. You only want to add the word after you've looked at all the words in array3

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

Agree. There never was a blank area for me either. Now there's a blank post with an AD icon, and that just started a couple days ago.

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

But in the forum list it does show replies, which lets you know if anyone has replied to the posting and that surely is more important than the number of people who have looked at it.

This is true. But I'm still trying to figure out what this popularity means. I'm looking at the main page for this forum an see:
18 replies, 2 bars of popularity
2 replies, 2 bars
5 replies, 1 bar
17 replies, 3 bars
2,3,8,10 replies: 1 bar

I see no need for this popularity key. How is it useful? Does it really help?

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

No I didn't, and I don't need to. Look at my point#3 and your code. Figure out what you are trying to do and what you did that didn't work properly. It's all right there in 5 lines of code. I already gave you a HUGE hint.

jonsca commented: WaltP IS a compiler ! +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Problem #1:
Your DisplayMenu() function is doing way too much work. It should simply display the menu. The rest of the code in that function should be in another function.

Problem #2:
Your DisplayMenu() function calls itself (called recursion) which is dangerous in this type of program. Unless you must, never call a function from itself just to start it over. Exit the function and put the original call within a loop.

Problem#3:
If you don't want garbage in your price value, look at what you loaded into the allPrices array during your read.

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

Since you claim Banfa is wrong, you need to explain how it crashes. We cannot help you fix a crash without knowing the error message explaining the crash.

Much of your problem deals with scanf() . Read this series to understand how to deal with the function when reading numbers and single characters.

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

My point was
1) it works -- therefore it doesn't seem wrong
2) the OP has no idea if you are right nor if they should even listen to one of us.

IMO, if you say something intuitively in error, at least give an explanation of some sort. We are contradicting what they've been taught, and they have no idea if we're experts or fools.

Simple solution- don't just say something that's intuitively unclear - point it out by simply adding something like:

And here's why.

Aia commented: Here's my point. Stop micromanaging. I'll explain what I want to explain. You are not authority in how it must be done, neither. -2
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

My guess is Dev C++, since it's no longer an active project :icon_wink:

Nick Evan commented: :D +12
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Poat CODE not links.

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

BGI Graphics are not supported under windows...

Since when? Last time I compiled code I wrote 20 years ago, it compiled and worked. And this was within the last year.

Even though BGI and Turbo are old, if you have something to complain about it would be much more helpful if you check your facts first. And keep opinions to yourself. They are not helpful when there's nothing the OP can do about it.

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

The first IF if(((i%16)==15) || (i==length-1)) basically tests if 16 bytes have been output -- the number of bytes needed for one line.
Within the IF, reoutput the same bytes as ASCII characters after a '|'.

The best way to understand this stuff is write down all the variables you see in the code in one column. Next to each variable write down the current values (if known). Then follow the code line by line writing down the changes in each variable.

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

You'd be much better off reading a line into a structure, then writing the structure. Very simple. One record after another.

You can't just blindly use fseek for the sake of using fseek and expect a file to have any useful format at all. If you back up in a file and write, you are writing over file data.

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

I'm Spartacular!

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

The rep icon colors reflect how your reputation was influenced. Green is good, red is bad, and the greyish-blue is neutral meaning your reputation was not affected, either because the reputation was earned in the Community Center and not in a technical forum, or because the person giving the reputation was a newbie with not enough rep power to influence anything.

OK, that explain it. I was wondering.

Would it be a useful idea to change the color of CommCenter rep so it can be distinguished from "I'm not important yet" rep?

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

>> However, it would be really really good, if we had an option at the top of the thread to auto expand ALL quotes in the thread... That way I can flick through like I used to without it being a chore?

I'm going to spend a few extra seconds to circumvent the default process and format it in a way that's sensible and readable.

like this. just add a space or dot after the open quote tag, move the close quote tag immediately after, then italicize the original quote snippet.


i recommend anyone else who thinks it's important to have readable inline quotes do the same thing.

Just leave out the quote tags. Why do all that extra work?

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

Thinking about it, why not the following system for quotes:

- name and link to original post in the dark gray header part of the quote,
- always visible, but only the first 10 lines (or less is the quote is shorter),
- if the quote is longer, "Click to Expand" to view the full quote and
- if expanded, "Collapse" to bring it back to max 10 lines.

That way everybody can quickly see what the quote is about and if desired, can expand to see the whole quote.

Have read a lot of postings here about the "post reply - quote" system, but haven't seen this suggestion so far. In my opinion it would be a significant improvement immediately understood by everybody (that is; including new members).

Then you haven't read my post on the 1st or 2nd day...

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

The rest of this discussion has been moved to http://www.daniweb.com/forums/thread284619.html

The discussion is theoretical and opinion and not helpful to a new student learning the basics.

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

I stopped eating spam when I realised its not healthy anymore :( [Too much bad cholestrol]

Spam nowadays are low on nutrition and taste. Sigh.

Anymore? Nowadays? Since when was it ever healthy? :icon_confused:

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

The ADA -- I agree. They make my teeth hurt too.

I also think flash sites should be banned, to, as well as automatic music and video, and flashing ads.

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

Oh, give it another week. There'll be more changes :icon_twisted:

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

Only call srand() once at the beginning of the code.

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

I don't see any code nor a specific question we can help with...

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

Look up srand() and rand() . Then use an if statement.

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

Since you are reading from the stdin, you should use the function gets(char *str) which reads from the stdin and does not include the new line character (\n) in buffer

Never ever ever use gets() . Here's why. While you're at it, see this too.