Click here to Skip to main content
15,891,865 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer22-Feb-18 21:06
leon de boer22-Feb-18 21:06 
Questionproblem defining a function inside a structure in c Pin
Member 1367832014-Feb-18 5:40
Member 1367832014-Feb-18 5:40 
AnswerRe: problem defining a function inside a structure in c Pin
David Crow14-Feb-18 6:09
David Crow14-Feb-18 6:09 
AnswerRe: problem defining a function inside a structure in c Pin
CPallini14-Feb-18 10:44
mveCPallini14-Feb-18 10:44 
Questionsetting Boundary condition X^2-Y^2 for solving Laplace equation for NxN grid. Pin
Member 1362564310-Feb-18 17:23
Member 1362564310-Feb-18 17:23 
AnswerRe: setting Boundary condition X^2-Y^2 for solving Laplace equation for NxN grid. Pin
Victor Nijegorodov10-Feb-18 23:07
Victor Nijegorodov10-Feb-18 23:07 
QuestionDefault Stack Size Pin
ForNow10-Feb-18 17:02
ForNow10-Feb-18 17:02 
AnswerRe: Default Stack Size Pin
Richard MacCutchan10-Feb-18 21:23
mveRichard MacCutchan10-Feb-18 21:23 
GeneralRe: Default Stack Size Pin
ForNow11-Feb-18 3:55
ForNow11-Feb-18 3:55 
GeneralRe: Default Stack Size Pin
Richard MacCutchan11-Feb-18 6:32
mveRichard MacCutchan11-Feb-18 6:32 
GeneralRe: Default Stack Size Pin
ForNow11-Feb-18 6:48
ForNow11-Feb-18 6:48 
GeneralRe: Default Stack Size Pin
Richard MacCutchan11-Feb-18 7:10
mveRichard MacCutchan11-Feb-18 7:10 
GeneralRe: Default Stack Size Pin
ForNow11-Feb-18 7:13
ForNow11-Feb-18 7:13 
Questionsmoothing issue Pin
Member 1367132810-Feb-18 1:59
Member 1367132810-Feb-18 1:59 
AnswerRe: smoothing issue Pin
phil.o10-Feb-18 4:57
professionalphil.o10-Feb-18 4:57 
GeneralRe: smoothing issue Pin
Member 1367132810-Feb-18 5:04
Member 1367132810-Feb-18 5:04 
QuestionHow do we cast void type Pin
luplup9-Feb-18 14:46
luplup9-Feb-18 14:46 
AnswerRe: How do we cast void type Pin
Richard MacCutchan9-Feb-18 21:49
mveRichard MacCutchan9-Feb-18 21:49 
GeneralRe: How do we cast void type Pin
luplup10-Feb-18 7:15
luplup10-Feb-18 7:15 
GeneralRe: How do we cast void type Pin
Richard MacCutchan10-Feb-18 9:54
mveRichard MacCutchan10-Feb-18 9:54 
GeneralRe: How do we cast void type Pin
luplup10-Feb-18 11:35
luplup10-Feb-18 11:35 
You too you misunderstood my problem i think, what you say will be handle by the type="float", and so ok a little "repeat" in the function but i find this better than 15 calc functions for each type.

So finally my real problem is for the "return value" that can have their type changed, its for that im thinking casting the void type that point to the initial variable, and i dont know if possible... im asking you.

So my real problem is this &vInt2 declared short int at start, that i want can change his type inside the function calc(), and without to have creating a new variable in the main scope.
Think that this vInt2 is a "main var" where i would do some operations, and automatically convert it to the right type if the initial type is not adapted.

So can we change a variable type without creating a new var !?

Finally if not possible, i can at least alert that this operation is bad for the initial type.
But i wanted to change the type to a bigger if possible, and so i can start with short int and handle more and more if necessary...



Edit: humm i spot a future problem that can break all when the type is changed so i would more think about how i can handle...

Finally my first interrogation come from: how i can protect my program about overflow automatically
So if you have more constructive suggestion...

modified 10-Feb-18 19:30pm.

GeneralRe: How do we cast void type Pin
Richard MacCutchan10-Feb-18 21:18
mveRichard MacCutchan10-Feb-18 21:18 
AnswerRe: How do we cast void type Pin
luplup12-Feb-18 8:00
luplup12-Feb-18 8:00 
GeneralRe: How do we cast void type Pin
jeron112-Feb-18 8:06
jeron112-Feb-18 8:06 
GeneralRe: How do we cast void type Pin
Richard MacCutchan12-Feb-18 8:24
mveRichard MacCutchan12-Feb-18 8:24 

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.