|
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
|
|
|
|
|
i remembered that i do this title when i start study TC2.0..
.
I'm a beginner of VC++...
|
|
|
|
|
i'm so sorry to ask the silly question..
i creat empty console application.
i have one header file that contain class declaration
another one cpp file that is class definition
the last cpp file is main file.
in main.cpp, StartJob is unknown.. don't know why. in logic i think that shouldn't be
an error.
<br />
class StartJob<br />
{<br />
public:<br />
StartJob();<br />
void GetStartJob();<br />
}<br />
<br />
#include "startjob.h"<br />
<br />
StartJob::StartJob(){}<br />
StartJob::GetStartJob()<br />
{<br />
cout<<"Start job now"<br />
}<br />
<br />
#include <iostream.h><br />
#include "Startjob.cpp"<br />
#include "startjob.h"<br />
<br />
void main()<br />
{<br />
StartJob ajob;
ajob.GetStartJob();<br />
<br />
}<br />
<br />
<br />
|
|
|
|
|
You do not need to include the implementation file:
Remove:
#include "Startjob.cpp"
That file is linked during compilation. You only need the header file (#include "startjob.h")
Also, I don't know if this is a typo or not, but you need a semi-colon after your class declaration in the header file:
class StartJob
{
public:
StartJob();
void GetStartJob();
};
"There's a slew of slip 'twixt cup and lip"
|
|
|
|
|
no.. no typo and i tried several ways.. it is not like borland c++. can't create a project just like that.
i don't know why i can't create object of startjob class
evenafter i tried created the new project and call the different name, the same problem is still remain.
dont' know how to fix it.
|
|
|
|
|
Can you post the actual error you are receiving?
"There's a slew of slip 'twixt cup and lip"
|
|
|
|
|
s.cpp is a main() method
k is class name
<br />
<br />
class k<br />
{<br />
public:<br />
k(){ cout<<"hi, how are you?\n";<br />
};<br />
<br />
#include "k.h"<br />
<br />
void main()<br />
{<br />
k aclass;<br />
<br />
}<br />
<br />
s.cpp<br />
E:\s\s.cpp(8) : error C2065: 'k' : undeclared identifier<br />
E:\s\s.cpp(8) : error C2146: syntax error : missing ';' before identifier 'aclass'<br />
E:\s\s.cpp(8) : error C2065: 'aclass' : undeclared identifier<br />
Error executing cl.exe.<br />
|
|
|
|
|
//k.h
//class k
class k
{
public:
k(){ cout<<"hi, how are you?\n"; } // need closing brace
};
//s.cpp, main method
#include "k.h"
void main()
{
k aclass;
}
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
i found it
the problem is on including a header.. i got the case problem.
#include "job.h"
#include <iostream.h>
#include <fstream.h>
#include <Afx.h> // it's <afx.h> not <Afx.h>
now everything fine.. thanks
|
|
|
|
|
i found it
the problem is on including a header.. i got the case problem.
#include "job.h"
#include < iostream.h >
#include < fstream.h >
#include < Afx.h > // it's < afx.h > not < Afx.h >
now everything fine.. thanks
|
|
|
|
|
CMyForm* prova;
prova = new CMyForm;
prova->m_edit.SetWindowText("ciao");
delete prova;
This doesn't work.
And the error is:
void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}
Because as Nish said
That won't work. The edit control has not been created yet!!!
So here comes my question:
How I create an edit control on another form so that I can use functions of it from other frames?
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
You need to call Create or CreateWindow, too. Sorry, I'm too lazy to put in the MSDN CD currently It's one of these functions.
What you are doing is creating the class with new, but not the window which is encapsulated. This requires a second step.
Martin
|
|
|
|
|
How can I understand if a drive is NTFS or FAT32 in my program?
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
|
|
|
|