|
Stray at line number
Hello all,
while running a small programm to test the exception handling code i am facing a very peculiar problem.
whenever i disk clean and rebuild all and then execute there is no problem. But even if i make a small change( just add whitespace or newline) in it and do not repeat the procedure above.....then there is an error during compilation with the following message.........
.....
exception:1376: stray '\307' in program
exception:1389: stray '\307' in program
exception:1396: stray '\307' in program
...and so on in some 1000 lines
However if i try to run the same program through command prompt it again works fine. And in KDE if i donot include iostream then again problem is removed.
here is the scrap of source code
please help me in this regard ASAP.
Vipin Sharma
main source file======
/***************************
main.cpp - description
-------------------
***************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include "./Include/Throw.h"
using namespace std;
int main(int argc, char *argv[])
{
cout << "Hello, World!" << endl;
printf( "Hello, World!");
try{
Throw(1);
Throw(-2);
}
catch(int)
{
// cout<<" Got invalid Integer argument";
printf(" Got invalid Integer argument");
}
/* catch(...)
{
// cout<<" Got invalid but not integer argument";
printf(" Got invalid but not integer argument");
}*/
return EXIT_SUCCESS;
}
===================
header file
***************************************************************
Throw.h - description
***************************************************************************/
#ifndef THROW_HEADER
#define THROW_HEADER
void Throw(int Error);
#endif //THROW_HEADER
===========================
source file
/***************************************************************************
Throw.cpp - description
-------------------
***************************************************************************/
#include <iostream>
#include "../Include/Throw.h"
using namespace std;
void Throw(int Error)
{
try{
cout<<" Argument Passed : "<<Error;
if(Error<0)
{
throw Error;
}
else
{
cout <<" Argument is valid";
}
}
catch (int error)
{
cout<<"Argument is invalid(as less than 0)";
throw;
}
}
======================
|