|
I have the following
dataout.setf(ios::fixed | ios::showpoint);
dataout << setw(10) << setprecision(5) << number << endl;
I get this result:
0.00000
How can I make it print instead:
.00000
Or, if I have the output:
-0.12123
How can I make it remove that 0 and print:
-.12123
Sounds really stupid I know, I have to make this data perfect in
order for it to work with this crappy fortran program.
Please, any response anyone can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
ummmm
sprintf() it o another string first and remove the zero manually then output the adjusted string?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
Someone can explain (or point me to some article) how to use ToolTips with Tab control? I need a plain Win API
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I've tried OnOK() but that only works in a Dialog. OnDestroy() and DestroyWindow() dont work either, and I dont know what else there is. Whats the function to close my program?
-Raffi
|
|
|
|
|
Try this:
PostQuitMessage(0);
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Thanks
-Raffi
|
|
|
|
|
Mazdak wrote:
PostQuitMessage(0);
This might kill the application unless there are other GUI threads. It's safer to post a WM_CLOSE to the window you want to close.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
hmmmmmmmmm,thank you Mr.Nish.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
i think use SendMessage function to send a WM_CLOSE message
can do it also!
I'm a beginner of VC++...
|
|
|
|
|
I use __try in my application but compiler give me this error for it:
error C2712: Cannot use __try in functions that require object unwinding
I read in MSDN :
To avoid this error message, compile using the /GX- option.
Now how can I do it?I don't know how to compile with an option!
Thanks
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
in your VC++ IDE
take Menu Item PROJECT>>SETTINGS (or simply ALT + F7)
and in the Project Settings Propertypage take the C/C++ TAB
in that there is a text box Project Options in that u must add that /GX
R_Renjith The True CP ian
|
|
|
|
|
Thats Project Setting in VC6,In VC7 there are some difference,Can you point it to me in VC7 project setting?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
project-->setting-->c/c++... add /GX option.
i think you can use command line to complile it also...
cl /... xxx.xxx
I'm a beginner of VC++...
|
|
|
|
|
Project...Settings...Compiler options
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
This is actually the Enable Exception Handing option on the Project Settings / C++ tab. Then select the C++ language option in the combo box.
By selecting this option, the /GX- option to the compiler for you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt wrote:
Enable Exception Handing
Do you use VC7?I can't find this option.There are other options.I disable Enable C++ Exception ,and error disappear,but some warning happend.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
You shuold use try, catch and throw and not the depracated __try or TRY etc.
Best regards,
Alexandru Savescu
|
|
|
|
|
Hi,
I have 2 questions here. Need your help . Thanking in advance.
Question1:
Write an application that prints the following diamond shape. You may use output statements that prints a single asterisks ( * ) , a single space or a single newline character . Maximize your use of repetition (with nested For structures)
and minimize the number of output statements . The desired output should be as below :
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
Question2:
Modify the program you wrote in Question 1 to read odd number in the range 1 to 19 to specify the number of rows in the diamond . Your program should then display a diamond of the appropriate size .
regards
|
|
|
|
|
Uh oh! I sense trouble!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
The CP community will be glad to help you have a specific question about this. But we'd be doing you a disservice if we simply gave you the solutions to these problems.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
what do you want? to print the diamond shape? if so use following code..
for(int i=0;i<10;i++)<br />
{<br />
if(i%2==1)<br />
for(int j=0;j<i;j++)<br />
cout<<"* ";<br />
cout<<endl;<br />
}<br />
for(int k = 10;k>0;k--)<br />
{<br />
if(k%2 == 1)<br />
for(int j=k;j>0;j--)<br />
cout<<"* ";<br />
cout<<endl;<br />
} <br />
|
|
|
|
|
i think u need it in c++
include Header files here
void main()
{
int nTotal,nCOunt;
cout<<"How much rows ?";cin>>nTotal;
while(!(nTotal%2))
{
cout<<"Enter Odd No :";
cin>>nTotal;
}
int i,j,k,l;
for(i=1;i<=nTotal;i+=2)
{
cout<<"\n"; //as u like the \n here hahah..
for(j=1;j<=i;j++)
cout<<"* ";
}
for(k=(i-4);k>=1;k-=2)
{
cout<<"\n";
for(l=1;l<=k;l++)
cout<<"* ";
}
}//end main
TRY IT NOW
RENJITH
HI FRIEND I THINK I GAVE THE SOLUTION AS U ASK ...
R U SATISFIED? NEED ANY MORE HELP??
R_Renjith The True CP ian
|
|
|
|
|
You miss headers because they are like html tags.When you send the message check the Display this message as-is (no HTML) check box then you can see headers too.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
hahaah
# include<iostream.h>
#include<conio.h>
#include<time.h> hahahahaaha i i can...!!! thankz...
R_Renjith The True CP ian
|
|
|
|
|
Homework questions are OK here, but we aren't going to do your work for you. Get started on the code, and when you get stuck, ask a specific question and post your code along with it.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|