Snipe hunting in C++

  • Thread starter Steven T. Hatton
  • Start date
S

Steven T. Hatton

Steven T. Hatton wrote:

That really would have done little in this case. What helped was C-x C-h
C-M-\, and then scrolling to the end of the file.

Whoops! make that C-x, h, C-M-_.
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
 
R

Richard Herring

Jonathan Turkanis said:
All caps is a must, but you also need a unique 'namespace' prefix. Furthermore,
while you're at it, you should correct some other language flaws. May I suggest

#include <vector>

#define PUNC_BEGIN_CURLY {
#define PUNC_END_CURLY }
#define PUNC_BEGIN_ROUND {
#define PUNC_END_ROUND }
#define PUNC_BEGIN_SQUARE {
#define PUNC_END_SQUARE }
#define PUNC_BEGIN_ANGLED {
#define PUNC_END_ANGLED }

int main
PUNC_BEGIN_ROUND
int argc, char* argv PUNC_BEGIN_SQUARE PUNC_END_SQUARE
PUNC_END_ROUND
PUNC_BEGIN_CURLY
using namespace std;
vector PUNC_BEGIN_ANGLED char PUNC_END_ANGLED v
PUNC_BEGIN_ROUND
10, 'a'
PUNC_END_ROUND;
for
PUNC_BEGIN_ROUND
vector PUNC_BEGIN_ANGLED char PUNC_END_ANGLED::iterator
i = v.begin PUNC_BEGIN_ROUND PUNC_END_ROUND;
i != v.end PUNC_BEGIN_ROUND PUNC_END_ROUND;
++i
PUNC_END_ROUND
PUNC_BEGIN_CURLY
*i = 'b';
PUNC_END_CURLY
return 0;
PUNC_END_CURLY

Could do better. See: http://www.cotse.net/users/jeffrelf/X.CPP
 
E

E. Robert Tisdale

Steven said:
That's only marginally helpful.

It was meant to answer the other part of your question,
"Do other people run into situations like this?"

Of course they do and it's much more serious
if you are a member of a team maintaining the same source repository.
Some kind of revision control system is essential
if you must work with other programmers on the same code.
 
M

Marcelo Pinto

Jonathan Turkanis said:
I'm not sure what you mean -- are you agreeing or disagreeing? I think my answer
is general enough to include using a version control system. (Personally I use
CVS.)

I thought you were saying making copies of all the files... :(
I also use CVS in my projects.

Marcelo Pinto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top