68 Posted Topics
Re: I don't understand either. Do you want a constructor? | |
Re: Second jwenting. I recommend learning java instead of visual basic, also because Microsoft has stated that VB won't be supported in the future. | |
Re: Maybe you could allocate an array and pass it together with an int telling the size of the array? | |
Re: You probably want to use string variables. You can do that with either a char pointer or a string class. As such: [CODE] #include <iostream> #include <string> // Header for string class. using namespace std; int main() { char *str = "--------"; string str_ = str; cout << str << … | |
Re: Show us your code and we'll be able to help you! | |
Re: That is just an assignment. How far have you gotten? Any thoughts on how to solve the exercise? | |
Re: My guess is also that a pointer to a struct would be faster when passed as a function parameter, instead of copying the whole structure. For example: When c code is translated into assembly; Passing a whole struct as a parameter would force the program to store all values on … | |
Re: Are you sure your file isn't saved with carriage-return linefeeds, '\r\n' instead of just '\n'? | |
Re: To find two factors you could do modulo with a variable that is incremented until the rest is 0. | |
Re: There is a very easy way to parse strings using atoi(). | |
Re: [QUOTE=jwenting;1151113]by simply installing a decent commercially available virus scanner.[/QUOTE] That wasn't any answer to the question however. Have you looked through the shell commands on msdn? | |
Re: But it isn't necessary. prog.cpp will compile anyway. | |
Re: [QUOTE=empror9;1150857]if he\she press 'w' so the hero must move up, the qustion how to do this by using loop?[/QUOTE] How about this? Getting the user input and then doing whatever required to move using a switch()? [CODE]bool doMore = true; char input; while(doMore) { cout << "Choose direction: "; cin … | |
Re: Do you have any other programming experience? | |
Re: Why not use the string class? [CODE]for(unsigned i=0; i<str.length(); i++){ switch(str[i]) { case ' ': str.erase(i, 1); break; default: break; } }[/CODE] This way it's easy to remove custom characters. Of course, when copying the characters into another string/array it's simple to apply toupper() or tolower(). Or you could include … | |
Re: 40 MHz is 40 million times per second. I'm not sure but would that mean you'd need to put 1/40M? About on/off, I've learned that it is a negative flank that triggers the interrupt, depending on the hardware it should be taken care of automatically. But I have only worked … | |
Re: As Lerner said. Check argc first, going further than argv[argc-1] will cause a segmentation fault. | |
Re: When filling out a number in order for it not to lose its sign you'll have to use the most significant bit. For example: 0100 -> 00000100, 1010 -> 11111010. Notice though, that this only concerns signed numbers. |
The End.