- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
9 Posted Topics
There is an easy mathematical way to do it, but in C++ one should write the program like this: #include <iostream> #include <string> #include <vector> #include <boost/lexical_cast.hpp> using namespace std; const int MAX_SIZE = 5; int main(vector<string> args) { try { int num; cin >> num; string str_num = boost::lexical_cast<string>(num); …
In this game, post confusing or hard to understand code, and the reader will try to figure out how it works. I will start with a small C++ program that uses #define's. #include <iostream> #include <string> using namespace std; #define FUNCTION(?????) ?????? FUNCTION(inline, int, hello, for(int d = 0; d …
But why does C consider `*y++` to be an incremention to the adress of y? This only makes code more misleading. Is there a reasonable answer to this wierd operator precedence order? And will `(*y)++` work as expected?
You cannot use main as a function pointer. It is undefined behaviour. #include <stdio.h> #include <stdlib.h> int i; int func(int nargs, char **args, int (*function)(int length, char** args)) { function(nargs, args); } int main(int nargs, char **args) { func(nargs, args, main); for (i = 0; i < nargs; i++) printf("%s", …
I am not a PHP programmer (then why am I on PHP forum?), but I can see that the error message means that the function expects individual strings instead of array of strings. So you have to loop through each word in the text and replace it separately (if PHP …
#include <iostream> using namespace std; int main() { const int NUMES = 10; int max = 0, i, grade[NUMES]; cout << "In this program, you will enter ten integer numbers and this program will find the maximum value of these ten numbers. " << endl; for(i = 0; i < …
> so is there any way to do this?? Install Turbo C? But seriously, why use such an old library? There is plenty of better, newer, cross platform alternatives. Look up SDL, OpenGL and Glut, or if you are evil and don't care about cross-platformness DirectX or XNA. If you …
MBR can only boot Windows, and Grub can boot Linux, Windows and other OSes (like BSD). So if grub is not default, you probably do not have acess to Linux. That means you have to boot it through a live CD, or if you can't boot live CD you have …
You do not need an assembler, or any other prog to program in binary, except a hex editor. Hexadecimal is baslically the same as binary, but it takes much less space. For example: binary hex 0001 1 0010 2 0011 3 0100 4 1111 F Then just rename the file …
The End.
ModernC++