Optional Practical Training (OPT)
Have your application number ready, You will be able to find the status of your case:
Have your application number ready, You will be able to find the status of your case:
std::cout.setf(ios::fixed, ios::floatfield);
std::cout.setf(ios::showpoint);
std::cout.precision(2);
Given: int one=4, two=44;
std::cout << one << std::endl.;
//output: "4"
std::cout << setw(2) << one << std::endl.;
//output: " 4"
std::cout.fill('X');
std::cout << setw(2) << one << std::endl.;
//output: "X4"
std::cout.fill('X');
std::cout << setw(2) << two << std::endl.;
//output: "44"
<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" rel="stylesheet" type="text/css"/>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript"/>
pre {
margin: 5px 20px;
border: 1px dashed #666;
padding: 5px;
background: #f8f8f8;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}- <body>
+ <body onload='prettyPrint()'>
<pre class="prettyprint">
source code
</pre>
#include <limits> // for std::numeric_limits
#include <string> // for std::string
#include <iostream> // I/O
#include <fstream>// file I/O
// Remove C/C++ comments
ifstream& SkipComment(ifstream &strm)
{
char c;
const int c_MAX_LINESIZE=std::numeric_limits<int>::max();
if(!strm) return strm;
while(isspace(c=strm.get())||c==','||c==';');
if(c=='#'||c=='%'||(c=='/' && strm.peek()=='/'))
{
//skip the rest of the line
strm.ignore(c_MAX_LINESIZE, '\n');
return strm;
}
else if (c=='/' && strm.peek()=='*')
{
//skip everything in the comment block
c=strm.get(); //skip the first '*'
char last='\0';
while(!(strm.eof())&&strm.good())
{
c=strm.get();
if(c=='/'&&last=='*')break;
else last=c;
}
return strm;
}
else if(c!=EOF)
{
strm.putback(c);
}
return strm;
}
//main program
int main(int argc,char **argv)
{
string IFile="test.dat";
ifstream ifs( IFile.c_str() );
if ( ! ifs ){cerr << "Unable to open " << IFile << " for reading\n";}
SkipComment(ifs)>>x;
SkipComment(ifs)>>y;
ifs.close();
return 0;
}