- Strength to Increase Rep
- +14
- Strength to Decrease Rep
- -3
- Upvotes Received
- 206
- Posts with Upvotes
- 176
- Upvoting Members
- 109
- Downvotes Received
- 36
- Posts with Downvotes
- 33
- Downvoting Members
- 23
Re: You're looking at the same problem, from WAY different perspectives. Narue has a lot of experience, at a high level, with languages, while VEGETA-DTX has very little experience, but STILL has a valid point to make. As the old quip says: (and I roughly paraphrase) "The great achievements of man … | |
Re: Line 17 puts the needed end of string marker char, into place. Remember, chars are just a bunch of chars, UNTIL they have an end of string marker in place, after them. bunch of chars: just a bunch of chars. now a string: just one string.'\0' It's confusing, because the … | |
Re: The path to the BGI drivers. | |
| Re: You've got a pointer to a pointer - and you've set aside no memory for it, at all. The algorithm may be OK, but it's not one I'd recommend you use. Strive for clarity and simplicity in your code. adding two matrices into a third matrix which is NOT a … |
Re: First, be aware that your code is C++, and you are compiling it (obviously) with a C++ compiler, instead of the C compiler. This answer works in C, but you may need to adapt it to work with C++. Sachi's code is also C, since this is the C forum. … | |
Re: A "void" is an empty area - like "space is mostly a huge void". It also means "amounting to nothing" as in "the lawsuit was made null and void". So a void function is any function that returns nothing. It may say "return" at the end of it, but it … | |
Re: Very interesting Brian, thanks for sharing! ;) And welcome to the forum. :) | |
Re: Turbo C has it's quirks, but here's some hints I use (and I use Turbo C/C++ (the C compiler portion), very often. 1) Use Turbo C/C++, NOT "Turbo C". Turbo C was an earlier product, and is buggy. Turbo C/C++ is fine - I recommend ver. 2.0, but 1.01 is … | |
Re: [QUOTE=keval_hack;1638142][I]Interesting tricky program using C & C++: [/I] [B]Program 1:[/B] Create a Program which produce output "Hello World" , the program must not contains semicolon ; in other word any statement of the program will not have a termination semicolon. [B]Program 2:[/B] Write a C or C++ program which run … | |
Re: sureshshan1292, in the spiral problem, you should be hearing warning sirens that your algorithm is too (low-level in the logic, explicit, or specific), and not abstracted enough. That is a LOT of code! Are you still interested in this problem, or did you figure out what you wanted, already? | |
Re: It's good. ;) The one I like moves the stream pointer for the keyboard - very elegant, but everybody asks WTF is THAT? | |
Re: Perhaps you are using the angle of 45 you have defined, instead of calculating the real angle on the bounce off the bricks, or the wall. If you Google for that equation, you'll find it easily. I don't have it on this system, but it's simple geometry. | |
Re: The bubble sort doesn't "bubble". ;) Bubble sort compares only adjacent values in an array. What you have labeled Bubble sort, is actually Substitution sort, which is in the same class, but compares non-adjacent array values, 95% of the time (or so). Also, Bubble sort usually has (and always should … | |
Re: You need the program to find up to 1 million prime numbers, in 5 seconds? That's a job for ya! ;) I just tried out my trusty prime number finder, and it took it 5.8 seconds with a pretty fast i7 cpu system (3.5GHz). To go from 10 seconds to … | |
Re: I believe you can run Turbo C in Windows 7, but it has to run inside a virtual machine. This is how it ran in WindowsXP as well, using the NT VDM. I haven't done this yet, but surely will some time soon. Google it, and also check out DOS … | |
Re: Welcome to the forum, Akshay1. This thread is 3 years old - how about starting a new one? More specifics of your assignment, would help. Also, what is stopping you from including string.h and using strstr() to find your string in the text file.? | |
Re: I applaud your energy, but you don't understand what programming is all about. The rare goto is OK, but there's no need for them in TTT. C (and all programming languages to some extent), are meant to be a concise and efficient way to do something. Where accuracy is paramount, … | |
| Re: If you're having problems with a do loop, you need to post up code that includes the do loop. ;) Using CODE TAGS! <of course> Putting your code right between code tags, lets your code stay looking like code, and not like a dog's breakfast. |
Re: You're all off the mark. The answer is "Whatever you want the difference to be." ;) | |
Re: Hi Nakul, Try to learn C the right way: 1) It's always int main(), never just main() or void main(), and it always has a return integer (generally always 0). 2) now let's make your program look like a *program* on the forum: Just click on the [.code] icon, in … | |
Re: One concern I have with your code is that x doesn't appear to be reset, so the while loops working with it, are going to go bust. I don't believe you understood the wisdom of deceptikon's post, right above yours. Your code looks positively PAINFUL. You don't need to work … | |
Re: If you know that all global variables, with no storage class mentioned, are 1) kept until the end of the program. and 2) available to your program in any function, without using a parameter. and 3) may be overshadowed or covered, by a local variable with the same name, in … | |
Re: size_t j = pon - string1[0]; is the index to the first char of string2, within string1. | |
Re: I like #1 or #3. #1 because it uses bit shifting, which is always fast. The only minus is the subtraction. I like #3 because it allows full optimization by the compiler - which surely is set up for something as common as multiplication, in unbeatable time. The #2 I … | |
Re: You need to add curly braces { } whenever you have an expression with multiple lines of sub expressions, or it won't work as you want it to. if(some test is true { first code expression; second code expression; } Without the braces being in the above, ONLY the first … | |
Re: If you want your calculations to be accurate at all, you need to use doubles or floats. Integer division is especially (spectacularly) diabolical. And "millage"? Really? | |
Re: I really like Pelles C for Windows. It's NOT C++, but it has an extensive help section, full IDE editor, debugger, profiler, and it's own forum for learning the in's and out's of using it. There is a learning curve for using it, because it is a Windows program. I … | |
Re: Use the PDCurses library for all the console control you could ever want. | |
Re: Syria has a great need for humanitarian help - US and it's Allies can assist there, (and is) in Jordan. The civil war in Syria will have to be sorted out by the Syrians (plus any other fighters from Islamic countries that will participate). It will be a huge war, … | |
Re: You need to remove the newline char that fgets() always adds to the end of the string it receives. Nice actually looks like this, when it's the last word in the string: "nice\n\0". And what you are searching for is "nice\0". So a bit of code for inside the for … |