You have not shown your incorrect usage of the abomination.
But that hardly matters.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
I get compiler error "cerr undeclared first use this function."
#define err_ret(e) cerr << e; return -1
...
err_ret("who ate my muffy?");
You need to have:
#include <iostream>
using std::cerr;
somewhere before the definition of your macro. However, I think the
real problem here is that you're using a macro when a function would do
just as well?
#define <iostream>
inline int err_ret(std::string e) /* or maybe char const *e */
{
std::cerr << e << std::endl;
return -1;
}
cerr << "who ate my muffy?";
The compiler states that 'cerr' is undeclared.
It may be that you've forgotten to qualify the name, 'std::cerr', which is
most likely.
It may be that you've forgotten to include the relevant headers.
It may be that this is a spurious message due to earlier errors.
No way to tell when you don't post the code.
So the context of the macro or not is irrelevant,
Both the context of the macro definition and of the macro usage are
relevant.
And the problem with your output statement is somewhere in the context.
Which you haven't shown.
you completely missed the point of my post.
Nope.
Perhaps you've learned that macros are evil and context is important.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Can someone tell me what is wrong with this simple code?
I get an exception every time at the myFile.Open() line.
I have included the code that I think is needed to for you to answer this
below:...
Hello all,
To begin, yes, this -is- a homework assignment. However, it is for my
Algorithms class, and my instructor has given us explicit permission to use
"expert" groups like newsgroups, so...
Hi,
how can one redirect std::cerr into a file? Specifically, if I have an
ofstream object, is there something I can do to make "cerr << ..." calls
write into that particular ofstream object?
...
Hello,
I am not entirely clear on the difference between cerr and clog. When it
is more appropriate to use one versus the other? I am coding a simple C++
application that will issue error and...
Hi guys
I am new to C++ and need urgent help with this part of my code for a
uni coursework I have to submit by Thursday
//ClientData.h
#ifndef CLIENTDATA_H
#define CLIENTDATA_H
#include...
I'd like to load a text file to memory. The code is like:
void load_dict()
{
static const string DICT("D:\\README.txt");
ifstream dict(DICT.c_str(), std::ios::in);
if (!dict)
{
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...