- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
8 Posted Topics
I'm afraid to ask this on SO because all I can get is down-vote so I ask it here.* ## **Question:** ## Does C/C++ compiler (e.g the popular "gcc") with OO concepts allocates/creates all data member if other data member are not in use? /************************************* * code for example: * … | |
Re: Well, I just comment here to tell my immediate guess about making scripting language. First of all know what software this lexer/tokenizer will be run into, e.g in browsers or you own made browser, which has an access to a specific and flexible built-in function to control some stuffs there. … | |
Re: you should enclose your file with [include guards](http://en.wikipedia.org/wiki/Include_guard) and attach a macro like this: (as describe in this [page](http://msdn.microsoft.com/en-us/library/ms235636(v=vs.90).aspx)) #if defined(DLL_PROJECT) #define DLLAPI __declspec(dllexport) #else #define DLLAPI __declspec(dllimport) #endif | |
Re: Default constructor **will only exist if you do not provide your own manually** hence the compiler will make a constructor for you (*that's why it's called DEFAULT constructor*)**because** in OOP manner, you cannot instantiate a new object without providing any constructor of that class. Suppose you make an instance of … | |
Re: #include <iostream> using namespace std; int main() { char ans = ' '; string ques = "Are you 18 years old or above? "; do { cout<<ques; cin>>ans; if (ans == 'y'|| ans == 'Y'|| ans == 'N' || ans == 'n') { cout<<"VALID LETTER"<<endl; //you might want to put … | |
Re: try to... change ` $db->exec("INSERT INTO customers VALUES('$fName', '$lName', '$email')");` to ` $db->exec("INSERT INTO customers VALUES(" . $fName . "," . $lName . "," . $email . ")");` or ` $db->exec("INSERT INTO customers VALUES(" . "'" . $fName . "'" . "," . "'" . $lName . "'" . "," … | |
Re: why don't you just use the `std::string` and let the `+` operator concatenates the string for you. I saw `cout`s here so I assume this is C++. I can't see your point of writing an existing **function**. Do you think you can implement a better one? | |
Re: //cout << "Enter a number to bet (1 - 12): "; if (number < 1 && number > 12) { cout << "The number you entered is out of range. Please re-enter (1 - 12)." <<endl; } else { break; } I think you have a logic flaw here...shouldn't it … |