Jump to content

  • Log In with Google      Sign In   
  • Create Account

noatom

Member Since 23 Jun 2012
Offline Last Active Aug 22 2014 01:12 PM

Topics I've Started

What do you think about my demo?

19 August 2014 - 12:07 AM

So, for a while now, I've been working on a demo for the first episode of the game series I want to start, "Mercy". But now, I'm stuck, due to financial problems, I cannot acquire what I need to finish the demo, and then start funding the first episode.

That's why I created a trailer and a steam greenlight concept page, thinking that maybe people will see it and maybe donate so I can complete it.

I'd love to see your opinion about the trailer/screenshots/ideea, here's the steam greenlight: http://steamcommunity.com/sharedfiles/filedetails/?id=302487949


extern definition?

14 July 2014 - 06:27 PM

So, until now I thought that extern was used in a declaration, just to say that the variable is actually defined somewhere else. But I tried this:

 

extern int i = 10; (global var)

 

to my surprise, the code ran fine. Can someone explain this?


Template non type parameters question

05 July 2014 - 06:31 PM

template <char const* name> 
class MyClass { 
  … 
}; 

So, apparently you cannot use literals with templates. The reason given is:

 

 

One of the problems with string literals is that two identical literals can be stored at two distinct addresses.

 

But what could happen in a worse case scenario? If it was allowed, then, could it happen that 2 exact same instances of a template would be created(because a new template instance is created for every combination of template parameters used in code), so, would that somehow pose a problem?


How is this a pass by value?!

01 July 2014 - 04:31 PM

// maximum of two C-strings (call-by-value) 
inline char const* max (char const* a, char const* b) 
{ 
    return std::strcmp(a,b) < 0 ? b : a; 
} 

// maximum of three values of any type (call-by-reference) 
template <typename T> 
inline T const& max (T const& a, T const& b, T const& c) 
{ 
    return max (max(a,b), c); // error, because max(a,b) uses call-by-value 
} 

int main () 
{ 
    

    const char* s1 = "frederic"; 
    const char* s2 = "anica"; 
    const char* s3 = "lucas"; 
    ::max(s1, s2, s3); // ERROR 

} 

So when the 3 parameter function is called, it takes a constant reference to the listed pointers. So basically inside the function, a would be a constant reference to a constant pointer.

 

Then the 2 parameter max function is called, which takes a constant char pointer(WHY IS IT THEN CONSIDERED BY VALUE, when clearly we see it takes pointers, and not values!)

 

Its kinda late here, maybe I'm interpreting this in a very stupid way, can someone clear it up for me?


Cross Platform C++ Database library?

27 June 2014 - 02:13 PM

I basically need a free c++ library for doing MySQL operations. It needs to work on Windows, Android, IOS, Mac. Does anyone have some suggestions? 


PARTNERS