Posts
 
Reputation
Joined
Last Seen
Ranked #107
Strength to Increase Rep
+14
Strength to Decrease Rep
-3
85% Quality Score
Upvotes Received
206
Posts with Upvotes
176
Upvoting Members
109
Downvotes Received
36
Posts with Downvotes
33
Downvoting Members
23
73 Commented Posts
~492.07K People Reached
Favorite Tags
Member Avatar for mikeandike22

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 …

Member Avatar for VEGETA_DTX
1
2K
Member Avatar for vvsmario

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 …

Member Avatar for Busuioc
-1
4K
Member Avatar for pvbhargav
Member Avatar for Hi-Tone

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 …

Member Avatar for Akbar_5
0
3K
Member Avatar for nivedita5

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. …

Member Avatar for 2teez
0
3K
Member Avatar for Louie_Rave

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 …

Member Avatar for markanderson4
1
4K
Member Avatar for tyrantbrian
Member Avatar for rizrash

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 …

Member Avatar for David W
0
662
Member Avatar for keval_hack

[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 …

Member Avatar for Ahamed_1
-1
2K
Member Avatar for sureshshan1292

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?

Member Avatar for ekambaram
2
3K
Member Avatar for jephthah

It's good. ;) The one I like moves the stream pointer for the keyboard - very elegant, but everybody asks WTF is THAT?

Member Avatar for David_50
0
6K
Member Avatar for binaryjc

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.

Member Avatar for pr@j@kt@
0
2K
Member Avatar for Anil2447

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 …

Member Avatar for Talha_5
0
9K
Member Avatar for cse.avinash

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 …

Member Avatar for vantrendin
1
6K
Member Avatar for Vandithar

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 …

Member Avatar for maha harshini
0
389
Member Avatar for ricciola

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.?

Member Avatar for shentong
0
3K
Member Avatar for mixmagz

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, …

Member Avatar for mkamrul
0
1K
Member Avatar for Josue198s

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.

Member Avatar for rajii93
0
222
Member Avatar for pittdaniweb
Member Avatar for rajii93
0
796
Member Avatar for nakul_pancholi

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 …

Member Avatar for arulgee6
0
1K
Member Avatar for shakin

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 …

Member Avatar for N1GHTS
0
257
Member Avatar for Neelam_1

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 …

Member Avatar for Neelam_1
0
201
Member Avatar for Thundermax

size_t j = pon - string1[0]; is the index to the first char of string2, within string1.

Member Avatar for Ancient Dragon
0
151
Member Avatar for nitin1

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 …

Member Avatar for rubberman
0
251
Member Avatar for Raymond Albert

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 …

Member Avatar for Adak
0
4K
Member Avatar for toniann.midori

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?

Member Avatar for toniann.midori
0
345
Member Avatar for logicslab

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 …

Member Avatar for deceptikon
0
389
Member Avatar for nitin1

Use the PDCurses library for all the console control you could ever want.

Member Avatar for deceptikon
0
1K
Member Avatar for aVar++

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, …

Member Avatar for HiHe
3
2K
Member Avatar for Thundermax

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 …

Member Avatar for Adak
0
212