Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: getting data from non-.txt files properly Pin
UserNameless3-Jul-09 21:45
UserNameless3-Jul-09 21:45 
AnswerRe: getting data from non-.txt files properly Pin
Rajesh R Subramanian3-Jul-09 22:50
professionalRajesh R Subramanian3-Jul-09 22:50 
GeneralRe: getting data from non-.txt files properly Pin
UserNameless3-Jul-09 23:30
UserNameless3-Jul-09 23:30 
GeneralRe: getting data from non-.txt files properly Pin
Rajesh R Subramanian4-Jul-09 2:51
professionalRajesh R Subramanian4-Jul-09 2:51 
QuestionSub programming in C Pin
Andrew Jenkinson3-Jul-09 21:19
Andrew Jenkinson3-Jul-09 21:19 
AnswerRe: Sub programming in C Pin
«_Superman_»3-Jul-09 21:57
professional«_Superman_»3-Jul-09 21:57 
GeneralRe: Sub programming in C Pin
Andrew Jenkinson4-Jul-09 22:20
Andrew Jenkinson4-Jul-09 22:20 
AnswerRe: Sub programming in C Pin
Stuart Dootson3-Jul-09 23:26
professionalStuart Dootson3-Jul-09 23:26 
Andrew Jenkinson wrote:
How do I exit a C subroutine


The 'return' statement. Either 'return' for a void function, or 'return value for a non-void function. A void function can also return by reaching hte end of the function. Here are some examples:

void VoidFn(int value)
{
   if (value < 0) return;
   printf("%d", value);
}

int NonVoidFn(int value)
{
   if (value >= 0) return value;
   return -value;
}


You can return from anywhere in a C function, but many people recommend using only a single exit point. Personally, I take the pragmatic approach - if it makes sense to return earlier than the end of a function, then just do it.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: Sub programming in C Pin
molesworth4-Jul-09 0:25
molesworth4-Jul-09 0:25 
GeneralRe: Sub programming in C Pin
Andrew Jenkinson5-Jul-09 0:42
Andrew Jenkinson5-Jul-09 0:42 
GeneralRe: Sub programming in C Pin
molesworth5-Jul-09 12:53
molesworth5-Jul-09 12:53 
QuestionMy Sql Connectiom Pin
MsmVc3-Jul-09 20:12
MsmVc3-Jul-09 20:12 
AnswerRe: My Sql Connectiom Pin
Christopher W. Smith3-Jul-09 21:00
Christopher W. Smith3-Jul-09 21:00 
QuestionRe: My Sql Connectiom Pin
MsmVc3-Jul-09 21:16
MsmVc3-Jul-09 21:16 
AnswerRe: My Sql Connectiom Pin
Stuart Dootson3-Jul-09 23:22
professionalStuart Dootson3-Jul-09 23:22 
Questionhide a dialog on task bar. Pin
chandu0043-Jul-09 19:12
chandu0043-Jul-09 19:12 
AnswerRe: hide a dialog on task bar. Pin
enhzflep3-Jul-09 19:30
enhzflep3-Jul-09 19:30 
QuestionSend values from Exe to Browser Pin
tgm.arjun093-Jul-09 16:59
tgm.arjun093-Jul-09 16:59 
AnswerRe: Send values from Exe to Browser Pin
David Crow3-Jul-09 17:35
David Crow3-Jul-09 17:35 
AnswerRe: Send values from Exe to Browser Pin
Hamid_RT4-Jul-09 0:00
Hamid_RT4-Jul-09 0:00 
QuestionConstructor Exception Pin
hpjchobbes3-Jul-09 9:08
hpjchobbes3-Jul-09 9:08 
AnswerRe: Constructor Exception Pin
Stuart Dootson3-Jul-09 9:26
professionalStuart Dootson3-Jul-09 9:26 
QuestionIE automation [modified] Pin
eoloe3-Jul-09 8:08
eoloe3-Jul-09 8:08 
AnswerRe: IE automation Pin
Stuart Dootson3-Jul-09 8:47
professionalStuart Dootson3-Jul-09 8:47 
Questionsimple template question Pin
minkowski3-Jul-09 6:53
minkowski3-Jul-09 6:53 

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.