Click here to Skip to main content
13,739,227 members

C / C++ / MFC

 
Questioni would like to be a programmer Pin
29-May-18 7:58
member29-May-18 7:58 
SuggestionRe: i would like to be a programmer Pin
David Crow29-May-18 8:31
memberDavid Crow29-May-18 8:31 
AnswerRe: i would like to be a programmer Pin
Victor Nijegorodov29-May-18 9:27
memberVictor Nijegorodov29-May-18 9:27 
AnswerRe: i would like to be a programmer Pin
CPallini29-May-18 23:01
mvpCPallini29-May-18 23:01 
AnswerRe: i would like to be a programmer Pin
jfbode102930-May-18 4:33
memberjfbode102930-May-18 4:33 
AnswerRe: i would like to be a programmer Pin
Vaclav_30-May-18 9:19
memberVaclav_30-May-18 9:19 
AnswerRe: i would like to be a programmer Pin
Tarun Jha5-Jun-18 10:53
memberTarun Jha5-Jun-18 10:53 
Questiontry /catch Exception missing type Pin
Vaclav_29-May-18 4:00
memberVaclav_29-May-18 4:00 
I am trying to improve my error handling skills.
I am somewhat happy with "perror", but that "requires" that the preceding code can report meaningful error messages. Most of the time all I need is "success" message and nothing more specific when error occurs.

There is a "feature" in Eclipse IDE which let me "surround" selected code , try /catch is one of them.
However, being a greenhorn , I cannot decipher this error message I am getting

Exception does not name a type

I know what "does not name a type" means , but HOW do I fix it for "Exception"?
I did Ask Mrs Google and she did not help much.

The extra block in the code is there because I just "surrounded" the perror line.
Of course the actual error message is not yet there, until I fix this missing type error.


Help will be appreciated.
Cheers
Vaclav


<pre lang="c++">
// returns file descriptor

int memfd = open("/dev/mem", O_RDWR | O_SYNC);
if(memfd)
{
try {
perror("Failed open /dev/mem ");
} catch (Exception e) {

}
exit(1);
}
</pre>
AnswerRe: try /catch Exception missing type Pin
Jochen Arndt29-May-18 5:09
mvpJochen Arndt29-May-18 5:09 
AnswerRe: try /catch Exception missing type Pin
Richard MacCutchan29-May-18 5:12
protectorRichard MacCutchan29-May-18 5:12 
AnswerRe: try /catch Exception missing type SOLVED Pin
Vaclav_30-May-18 9:06
memberVaclav_30-May-18 9:06 
GeneralRe: try /catch Exception missing type SOLVED Pin
leon de boer30-May-18 16:25
memberleon de boer30-May-18 16:25 
Questionhow to correct an segmentation fault ? Pin
Tarun Jha26-May-18 11:55
memberTarun Jha26-May-18 11:55 
SuggestionRe: how to correct an segmentation fault ? Pin
Richard MacCutchan26-May-18 21:10
protectorRichard MacCutchan26-May-18 21:10 
AnswerRe: how to correct an segmentation fault ? Pin
CPallini29-May-18 0:01
mvpCPallini29-May-18 0:01 
GeneralRe: how to correct an segmentation fault ? Pin
Tarun Jha5-Jun-18 1:50
memberTarun Jha5-Jun-18 1:50 
QuestionMessage Closed Pin
26-May-18 6:27
memberben lewis26-May-18 6:27 
QuestionGraphical representation of Data Pin
sree7926-May-18 1:09
membersree7926-May-18 1:09 
AnswerRe: Graphical representation of Data Pin
Richard MacCutchan26-May-18 2:41
protectorRichard MacCutchan26-May-18 2:41 
GeneralMessage Closed Pin
26-May-18 6:24
memberben lewis26-May-18 6:24 
GeneralMessage Closed Pin
26-May-18 6:26
memberben lewis26-May-18 6:26 
AnswerRe: Graphical representation of Data Pin
leon de boer26-May-18 5:09
memberleon de boer26-May-18 5:09 
GeneralRe: Graphical representation of Data Pin
sree7927-May-18 17:44
membersree7927-May-18 17:44 
Questionvolatile issue - repost Pin
Vaclav_22-May-18 5:24
memberVaclav_22-May-18 5:24 
QuestionRe: volatile issue - repost Pin
Richard MacCutchan22-May-18 8:26
protectorRichard MacCutchan22-May-18 8:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180920.1 | Last Updated 21 Oct 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid