What is it doing that you don't expect? The first problem I stopped reading at is that you call fclose even if the file fails to open.
Type: Posts; User: Kip Neuhart
What is it doing that you don't expect? The first problem I stopped reading at is that you call fclose even if the file fails to open.
Do you realize that the majority of your questions can be answered by reading a manual? Most programmers find it annoying when you ask a question that can be easily answered with a look through the...
Yes.
I believe that the default for Cygwin only installs minimal packages. Read the Cygwin FAQ for details on how to install further packages.
>error: initializer element is not constant
You can't call malloc outside of a function. Global initializers must be constant.
Use perror instead of printf for more details on why the file couldn't be opened.
perror("File could not be opened");
Most likely the file couldn't be found because it's in the wrong...
This has all the signs of HEADINGMAP not being a type. What does the declaration of HEADINGMAP look like? I was under the impression that you were doing something like this.
typedef map< string,...
getline is overloaded for the string class.
string name;
string address;
string account;
cout << "Input suppliers name: ";
getline(cin, name);
cout << "Input suppliers address: ";
Assuming pt_ptr is a pointer to a structure that defines a y member and actually points to something, and that the y member is an arithmetic type (probably double), yes. It does what you think. But...
>where is the +10 elements coming from?
The pointers of the name array.
>But can we write a file in notepad and read it from the program?
Yes, of course. It would be inconvenient indeed if C++'s file I/O only worked on file that was originally written by a C++ program....
This is the best I can do with what little detail you've provided.
ostream& operator<<(ostream& out, const HEADINGMAP& hmap)
{
// Code to write the contents of hmap to out
return out;
}
Only the result of the expression is checked for the null character. The result of the expression is the value of *s. However, because the expression was assignment, it's a safe bet that *t and *s...
>, and ; are both operators
No, they're both tokens. A comma has use as an operator or a punctuator depending on the context, but a semicolon is not an operator, ever.
>so where is ;(semi colon)...
xchat has a Windows build.
You want to work through several test cases of varying complexity. Look for patterns in how one number carries over into the next. This should give you an idea of how to begin developing your...
Of course. The num1 vector still contains integers, you're just using an intermediate step in acquiring them to make life easier. getline reads a line from standard input, and sin converts the...
Integers can be compared with character literals. The problem is that cin's >> operator is delimited by whitespace. It won't read a newline. A better way to go about this would be to use getline and...
>a simple but important difference
Well, if you want to get technical linguistically, returning nothing is equally accurate to not returning anything. Anything is defined as "Something or someone...
>How can you return nothing?
I believe that explaining
void f(void)
{
return;
}
and
Why not set a pointer to the beginning of the array in main, then pass a pointer to that pointer to findtag. That way you can update the pointer yet still use it in main for your loop test.
...
How an implementation interprets the standard may vary, though a "function returning void" is accepted terminology for a function with void as the return type and semantics for no return value.
It appears that the question was about the concept of returning void as meaning no return value, not about the void keyword in general.
Unions are used for reducing storage costs, accessing data with different internal representations, and creating a poor man's polymorphism.
Reducing storage costs entails exactly what you would...
This should get you started.
int main(void)
{
char again;
do {
[...]
} while (again == 'y');