hooray...!:cool:
well, it also works with double.
inline double fmax(double a, double b)
{
const double result[2] = { a, b };
return result[static_cast<unsigned int>(result[0] <...
Type: Posts; User: cph
hooray...!:cool:
well, it also works with double.
inline double fmax(double a, double b)
{
const double result[2] = { a, b };
return result[static_cast<unsigned int>(result[0] <...
guilty as charged. :D
do I have to do this:
inline int fmax(int a, int b)
{
const int result[2] = { a, b };
return result[static_cast<unsigned int>(result[0] < result[1])];
}
I probably saw this somewhere, but can't remember where and when.:D
inline int fmax(int a, int b)
{
const int result[2] = { a, b };
return result[result[0] < result[1]];
}
hmm...you probably could combine that (command line args) with this
you could start from here.
#include <stdio.h>
int main (void)
{
printf("\b");
return(0);
}
well, that was easy...:D
well, sometimes some people like to do things their own way, hence the function pointer :D
if I'm not mistaken, that's a pointer to a function that takes a pointer to type void as a parameter and returns nothing (void).
u r welcome :)
sprintf won't print anything, it stores the result in a buffer
well you could use a temporary array of chars to store the intermediate result, do some string dump, and push the final result to the stack.
sprintf probably could do the trick
EDIT: oops!
ah...okay :D
dear OP,
if you want to get a positive result (instead of negative), then you should do this (just like what ssharish2005 did)
int total = 25 * 50 - 100;
total = 100 - 25 * 50
and the answer will be -1150. what's wrong with that?
total = 100 - 25 * 50
total = 100 - 1250
total = -1150
pick one, please.
um...I suggest you should really get started.
how about a combination of strcspn & strtol?
hmm...yes, it should be int main (void)
3000 lines of code get posted in a forum? that'd be a world record, LOL.
I think the OP said that he/she is going to be back anytime soon, let's hope not for asking some more useless questions :)
ptrMC=&myCars[3];
I think it should be
ptrMC = myCars;
and
hmm...are you planning to participate in some kind of obfuscated programming contest?
Thanks to everyone for the explanation :)
sorry, I should have done some searching first :)
does EXIT_SUCCESS always expand to 0 on all system/OS ?
if main should return 0, why there exist EXIT_SUCCESS?
do I have to do this :
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
/* blablabla... */