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

When I do, the following errors come up (Not sure if they're interrelated):
16 cannot convert `double (*)[4]' to `double' for argument `1' to `void gauss(double, double, double, int)'

Look at the definition of the function and carefully check the values used in the call on line 16. Are they identical?

56 expected unqualified-id before "return"
56 expected `,' or `;' before "return"
and
57 expected declaration before '}' token

Use consistent formatting in your code and you will see immediately what the problem is. See this if you need help.

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

Well, I have multiple folders being created by different functions depending on what is selected from the menu. Would I be able to create differently named folders with the time function?

You can create any names you want. You are in complete control of the code and what each name contains.

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

ok so i still have no idea how to do this. alittle more help would be appreciated.

Help requires a question that can be answered. Details about what you need help with, and the current state of the code.

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

As I said, don't worry about it. Your task is not to learn how to bullet proof your input but to simply use proper input correctly.

Bulletproofing comes later in the course -- at least it better.

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

Functionally identical means they will both overwrite memory with wild abandon and laugh at you when your program crashes. And there's nothing you can do to prevent them from doing it.

jephthah commented: haha +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Create the name using the time functions from ctime

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

1) Use a for loop. It is made to go from one number up to a second number.

2) Don't use conio.h functions. They are not standard and are unnecessary. There are standard functions to accomplish the same thing.

3) In the loop, simply add the current number to the answer, which starts at 0.

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

I suggest:

infile.open("C:\\pathnameToFile\\charsfile.txt", ios::in | ios::out);

to make sure you can see the file during development.

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

Looking at your program, there are few things I haven't touched yet, like the goto statements but I get the general idea, so thanks.

Good. Stay away from the goto statement. It's considered bad programming and almost always an unnecessary command in C++.

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

Please use gets() instead of scanf() if you expect spaces in the user input. scanf() does not handle spaces the way you want it to work.

gets() is not an option, because there's no way of controlling how much data can be inputed. There's no way of using it safely.
scanf() is an option to read input string, but a mischiefing one.
A better option to read string input would be fgets().

gets() and scanf("%s", ...) are functionally identical. See this to understand why you never use either.

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

Be kind, Aia - she's only been programming for a few days.

Agree. Just because the experts know about input problems, the purpose of this code is not to be bulletproof, but to learn mathematical concepts.

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

Try: fp = fopen("C:\\path\\to\\file\\Keywords.txt", "r");

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

What's with all the getchar() lines?

What are the values just before the calculation? Print the values.

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

Stop flooding the forums with new threads on this program. Use THIS thread only for your project.

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

Multiple threads on one topic. Closed.

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

Read the first entry of the file to get Sales. Load hsales and lsales. It's ain't rocket science.

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

By changing your code to use the proper statements. Given the above lack of information, that about all I have for you.

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

You're close.

This code if((array2[i] <= 'a') ||(array2[i] >= 'z')) says
If the letter is ('a' or less) or letter is ('z' or more) ... Is that what you want?

Rethink this if statement. What are you really trying to look for?

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

I am trying to find what is causing the problem,but...unfortunately can't find it, well I have same piece of code, but with more info in it, it works fine...saves, displays everything..i am missing small piece of code in my program, and have to find what is it.

Well, In all the posts you've made here, not once did you acually ask a really good question. The only problem you mentioned was there is no data in your program when you start it running. I answered that one.

As for any other problems, start asking real questions about them.

my compiler is fine,

Sure it is. And when someone goes to Iraq, a Medieval Suit of Armor with a sword is fine, too. You learn 1980's technology, you can't get a job in the 2010's because you don't have the knowledge of the past 25 years. That's fine too, I guess.

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

it if LEN(textbox1.text) = 0 THEN Msgbox("Please...")

I repeat, "But what if there are SPACEs in the text box?

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

Completely worthless description without context. Start at the beginning, not the tail end of the problem. Remember, we aren't there watching how you got to this point.

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

Stop editing the errors. Post the entire error message, from beginning of the line to the end of the line. And although it is good to post the line itself, context is important. Post the entire code.

The last two errors just mean that you have not written the code for the function.

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

but what should i change?

I don't know. It's your code. I guess I'd change:
1) anything that doesn't work
2) all that gotoxy() crap
3) your compiler. Update to a new compiler, not one that's been dead since the mid 1980's. But I assume it's your lame instructor making you learn stuff that's 25 years old rather than giving you proper tools.

If you ask an answerable question rather than a vague idea of a question, you can really get good help. But since we aren't writing your code, we can't really answer vague "what do I do now?" questions easily.

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

But what if there are SPACEs in the text box? How about using If trim(Text1.Text) = "" Then to be sure.

lloydi12345 commented: great! +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

So post the errors. Don't just describe the errors. You are missing most of the relevant information when you just tell us kinda what the error is.

And code goes with the errors.

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

but, how would i do that? can you tell me please, which changes to the code should i make?

No, but I can help you change it.

You obviously know how to write a file. Look up how to read a file. That's your first step.

Second step is figuring out where in the code you need to do the read. That I leave to you the think about. Come up with an educated guess and ask again.

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

LOL. wht can i say .. i just started c++ and made this prog today.!

Say you're sorry, don't do it again, and Read the Member Rules!!! Violating the rules will get you banned from the site.

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

Why is it new people always think that "something is wrong" is an explanation of the problem? If you take your car to get fixed, will "something is wrong" be enough for the guy to correct the problem?

Details! What is wrong? What did you expect to happen? What actually happened?

And clean up your formatting! the code is a mess and hard to follow. See this.

And yes, it's true. You can't

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

Hi everyone, I have written a program here about customers, it works fine so far, but I am having a problem with getting customer details, for example, when I enter customer name, age...etc, it saves this info into a customer.txt file, I can see this information until I exit the program. But when I exit it and run same program again, I would like to see this info (option 2 in the menu), it shows nothing((( strange!!!! because the customer.txt file is not empty, and has info in it.

It's not strange at all.

The customer file contains the data. The program contains only code. You need to read the file to populate the program data before you can display the information.

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

I for one refuse to revisit the exact same subject anew. You already have help in your other thread. Continue there.

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

I did the code tags...

jonsca commented: "with all the help about them, how could you miss using them????" -- Dr. Walter P Codetags (I'm thinking of starting a WaltP quote wall somewhere) +2
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Trouble is, I do not know what the first value will be, I am just presented with 3 different files and the first value is different each time

You know when you read it.

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

Start eliminating the errors.

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

I don't understand the problem. If you have the word in a database, and they type in the word, it seems a simple matter to compare them. What are you leaving out of your description?

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

Please format your code so we can see the flow. Your indenting is too inconsistent to follow. You claim it will not loop. With about 10 loops can you be a little specific?

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

Your code is:

#include <iostream>
#include <sstream>
using namespace std;

int main()
{
string line;
getline(cin, line);
// Create a string stream that will read from "line"
stringstream ss(line,stringstream::in);

// While there are more tokens...
while (!ss.eof())
{
string token;
ss >> token;

//display token for testing
cout << token << endl;

Now that you have a token, what do you need to do with it?

}; //end while

// The should be one and only one item left on the stack
// print the item at the top of the stack
return 0;
}
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Resurrecting and hijacking an old post is not a good way to introduce yourself.

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

I'm still waiting for you to answer my question.

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

Should i put it at the top? Before the input? Can you point that out to me?

Stop answering a question with a question. The answer to my question is a simple yes or no. And if you answer that simple question, you will be closer to knowing what to do once you think about it.

I get this, the variable 'playagain' is being used without being initialized. What's wrong?

The first time you use playagain you are testing it. But what is it's value before that? It could be anything. You need to start it out with a value.

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

Think. Where is your input? Where is your loop? Is your loop in the correct place?

I repeat -- Think! It's important when you write code.

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

Do you want to restart hsales and lsales every time through the loop? Is that what I recommended?

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

I repeat -- do you want to roll the dice only once in your program or for each turn?

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

Then IMO you need to start over. Write a little bit, get it working. Then write a little more, get it working. Write a little more....
Trying to debug 260 lines with no idea where the errors could be is very difficult.

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

In Borland 5.5 is erases the input.

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

I did. Or are you asking us to write it for you.

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

Start your high and low with the first value read. Then compare each consecutive value with the high and low and change accordingly.

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

I meant the code...

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

First things first -- format your code so we can follow what you are doing.

The concepts looks good except for the ';' on line 6.

I'd also change the names of stack and stack2 to value1 and value2

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

How do you exit the loop?
Do you want to roll the dice once then loop or do you want to roll the dice in the loop?

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

Hmm, I was going to do that, but our instructions said not to convert to seconds.

Ah well, I think I'm just going to have to keep tinkering with it and maybe try something different. Thanks for your help, everyone.

Edit:
Fixed the blocked loops and I get the seconds right! So I did do it wrong. All fixed, thanks!

Care to share?