- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
41 Posted Topics
Re: 1860^3 = 6,434,856,000 long = 4 bytes (even unsigned < 4,294,967,296) | |
Re: I was reading the discussion here and wondering why did you give up the stl vector idea? > Ok. Can you then set a max on the number of shoe objects then like before? Yes, you can define a maximum of elements in stl vector, even if stl doesn't provide … | |
Re: Are you sure you entered value `2` for player 1 and not for player 2? Just a hint. Replace this: char square[10] = {'o','1','2','3','4','5','6','7','8','9'}; // ... if(a%2==1) { cout<<"player 1 enter your num\n"; cin>>b; } else { cout<<"player 2 enter you number\n"; cin>>c; } if(b==1&&square[1]=='1') square[1]='X'; else if(b==2&&square[2]=='2') square[2]=='X'; else … | |
Re: Well, except for some C coding problems (`conio.h` is not in any standard and `goto` is recommeded for interpreters not for compilers), you have a problem in logic here (lines 51-57): for (csPrelim=0; csprelim<3; csPrelim++) { printf("\nEnter The Class Standing (prelim) :"); scanf ("%f", &csPrelim); if (csPrelim<=49) printf("Invalid Grade!"); } … | |
Re: Do you know the algorithms? Have you tried any code? | |
Re: There is no error in your code. If you want to see the compilation errors, check "Build" from VS menu. If you want to keep the console active, check this thread: http://www.daniweb.com/software-development/cpp/threads/445548/32-console-window-closes-on-program-run | |
Re: Because of this: this.$el What is the intend of `$el`? | |
Re: As far as I could understand your code, you are bound to run into two problems: 1. redundancy (at every new iteration over `t`, you compute again the set of values which were computed in previous iteration); 2. crash (setting `n` too high is bound to require more memory than … | |
Re: Have you tried anything by now? If yes, could you show us what you did and where you got stuck? | |
| |
Re: Creating a new thread with the same problem won't help you more than explaining your problem. Consequently, you need to explain your problem which should be related to the points where you got stuck. Those points should be related to C++ in this case. So, try to explain what's your … | |
Re: [Here](http://www.site.uottawa.ca/~ivan/RRS%20AckBSM.pdf) is the pseudocode (page 5 of the PDF, page 37 of the journal). | |
Re: bool is_leap_year( int year ) { if ( year % 4 == 0 ) return true; return false; } | |
Re: > I do know it would be complicated > [...] in this case it is indeed impossible without introducing assumptions about the contents of the array or relying on non-portable solutions. Both right. There is a solution, but is complicated and non-portable. It's both complicated and non-portable because you rely … | |
Re: Shortly, inheritence refers to extending/changing the functionality of a class without reimplementing the class. That means, if you have class A and you want to add more (or to change) functionality, you define class B: (inheritance access level: public, protected or private) A which is read as "B inherits A". … | |
Re: Another method is coming from the observation and you don't need `math.h`. Let's have a look at the definition (see previous post): 1010 in base10 = pow(2,3) + pow(2,1) = 10 ^^^^ 3210 = position of each bit So, `1010` is converted from base 2 to base 10 like this: … | |
Re: Except for the typo or whatever for (i = 0; i = 5225; i--) // ??? try initializing the array with less than 1024 and see if you get the same problem. (edit) At the second thought (I missed that part when I posted the previous message), you have loop … | |
Re: > It's completely safe...because it won't compile. ;) Using `dynamic_cast` won't compile. Using `static_cast` will compile, but trying to access a redefined member (e.g., A has foo() and B has foo() as well) will give you a nice segmentation fault. So, I suppose that is what he meant by "ensuring … | |
Re: There is something I don't quite understand in your code: you delete `CurrentNode` and you call `CurrentNode->pNext` after. Does it really call anything that way? | |
Re: Is it me or you have no call for function `init()`? | |
Re: > what's your question about the problem? I think this is his assignement for school. Speaking on my behalf, guys, I won't write your homeworks. | |
Re: I read that article from Wikipedia in its full length a month ago or so. From what I noticed, the general idea of those changes is to make C++ more competitive and I agree with most of those changes. About uniform initialization, that may come from the languages where the … | |
Re: Why don't you put directly `tee` as piped from the `tar -v` command? LOGFILE="log-$date.log" tar cvpzf $backup_dest/$filename $backup_source | tee $LOGFILE | |
Re: Linux server administration goes pretty much from booting Linux to configuration and installation + compatibility. C/C++ and JAVA most probably for debugging installations and less for dev. LAMP (Apache webserver + MySQL + PHP) pretty much says about what kind of servers they speak about. Also, LAMP can explain why … | |
Re: There few major problems with your code (except for mixing C and C++): 1. you confuse room number with entry number; 2. you define a certain size for your arrays from the beginning, while further in your code no condition is imposed (e.g., what if `r` at line 31 is … | |
Re: Could you post some code you have by now and you need help with? | |
Re: > As a side issue, have you tested the getNrDigits function thoroughly? Seems to me that 01172013 and 11172013 are both valid. Does getNrDigits accept both as valid? As long as the numbers are recorded as `int` and not as string or array of chars, `getNrDigits` provides the correct answer. … | |
Re: I would go for `Interpreter` (quite a basic one, though) + `Command`. `Builder` doesn't seem to be appropriate because the menu items are independent (even if you can extend the string defining the menu). My 2c opinion. | |
Re: > std::cout << "You entered" << std::cout << date; There is the problem. Try: std::cout << "You entered" << date; (without the second `cout`) | |
Re: Here is something to start with: int getNrDigits(int my_int) { int local_int = my_int; int count = 0; while (local_int > 0) { local_int /= 10; count++; } return count; } I hope I didn't missed anything because this was *programming on paper at late hour* as somebody called it … | |
Re: There is all the time a trick you can use: char c; cout << "Press any key to close"; cin >> c; Add this before `return 0`. | |
Re: Arrays are used when one needs random access of its elements and when insertion of a new element is done by extending the tail of the container. Also, an array can be used when there is a need of mapping one set to another. Otherwise, some other types of container … | |
Re: Two simple comments here: 1. If you read char by char from your input file, you don't need `char*`. 2. Is it me or you don't perform any actual reading from the input file? If that is what you are looking for, see `>>` operator (`Map >> gridMap[i][j]`). | |
Re: Here is another solution in which the articles are set once in `fillProducts`, the rest remains untouched if the number of products is changed. Also, `fillProducs` can have any other logic inside (e.g., reading from a file/database/...) as long as it provides the vector. #include <iostream> #include <vector> #include <string> … | |
Re: The basic idea may be: 1. Define a class/structure/union player. 2. Put the players in a list/vector/array container. 3. Define an RNG (in the case of pyramidal exclusion) or permutation generator (in case of all vs. all) to extract cuoples of players. 4. Add stats to each player at the … | |
Re: I don't know about MS-VS, but aren't VK_'s vars some sort of constants and not strings? From your description it seems `switch` enters all the time in `default` branch. I might be wrong though because I am not into MS-VS. | |
Re: Following your logic, there are two options I can think of in this moment: 1. create a static member in each A1 and A2 to keep the description of the class and you can access it in if condition; 2. if the description of each child doesn't change, you can … | |
Re: Also, take a look at BOOST library (interprocess communication). | |
Re: There is a nice and short explanation about the difference in between derefence and reference operators here: http://www.cplusplus.com/doc/tutorial/pointers/ These two operators can be tricky sometimes. I know it from my own experience. ;) | |
Re: Few problems here: 1. Function definition inside another function (take all the function definitions outside the `main` function scope). 2. Missing `}` (you open 4 curly brackets for: `main`, `while`, `if`, `if` and you close only 3 curly brackets). 3. Missing `;` after `scanf` (line 75) 4. Is there any … | |
Re: The extraction operator (>>) should have nothing to do with your error because `seekg(0, ios::beg)` is modifying the internal stream pointer. For example, the code: #include <iostream> #include <fstream> using namespace std; int main() { ifstream f ("example.txt"); int x, y; for (int i=0; i<3; i++) { f >> x … |