- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 38
- Posts with Upvotes
- 25
- Upvoting Members
- 22
- Downvotes Received
- 23
- Posts with Downvotes
- 14
- Downvoting Members
- 10
I'm the type of guy who says "I don't know the answer" if I really don't know the answer and who says "You're right and I'm wrong" if I really think so. And no, I didn't copy this from "In Pursuit Of Happiness".…
- Interests
- Varied
- PC Specs
- Computer Specs - Beyond hopeless! OS Flavor - Windows XP but I like the MAC OS (which means a hole through…
Re: This type of problem is best solved with the help of recursion Here is the algorithm accept [number] if number is greater than 9 extract numbers and multiply them together till the original [number] becomes zero send the result as parameter to this function if number is not greater than … | |
Re: Even after starting C, most books (or links) only say what we should do. But the user(for me example) remains ignorant about the "DO NOTS", and by mistake, might indulge into the wrong programming practices. [URL="http://www.ibm.com/developerworks/aix/library/au-hook_duttaC.html"]This[/URL] link will surely help. | |
Re: Use [URL="http://sourceforge.net/projects/codeblocks/"]Code::Blocks [/URL] No problems and no hassles! | |
Re: [QUOTE=jonsca]I don't believe there is any standard method for reducing the text size.[/QUOTE] This is the crux of the problem. You cannot view more than 50 lines at a time in DOS mode (as far as i know). But there is a trick. It involves pausing the screen after every … | |
I've tried to make a [URL="http://en.wikipedia.org/wiki/Deque"]DEQUE[/URL] program. My book on data structures (Seymour Lipschutz) doesn't have an algorithm on DEQUES. Neither does [URL="http://www.itl.nist.gov/div897/sqg/dads/HTML/deque.html"]DADS[/URL] give a good description. All I heard was that it could be implemented better with two lists (one forward and one backward) & there are 2 types … | |
Re: I would suggest [URL="http://sourceforge.net/projects/codeblocks/"]Code::Blocks[/URL] | |
Re: I hate bringing up old threads but I was thinking about this but did not have the courage of asking a MOD but this seems like a good opportunity. So, can i make a list of Common malpractices of C? | |
Re: There you go [CODE]#include <iostream.h> #include <conio.h> int i; int a[10]; int main() { cout<<"\n\n\tEnter The 10 Numbers : \n"; for(i=0;i<10;i++) { cout<<"\t"; cin>>a[i]; } cout<<"\n\n\tThe 10 Numbers In Reverse : \n\t"; for(i=9;i>=0;i--) { cout<<a[i]<<"\t"; } return 0; }[/CODE] | |
I was writing a file copying program. Mind you this is an any file copier. That is, at this moment, this function can copy only text files but i'm trying to copy mp3 files, avi files, mkv files etc, which this cannot. Here is just the copying function. However it … | |
Re: Hello vanan4u These are your errors 1) You have declared the return type of main as void but returned an integer. It is recommended to use int main(). See [URL="http://www.gidnetwork.com/b-66.html"]here[/URL] 2) You have made a system call, however forgot to include the necessary header files for the function (stblib.h). However, … | |
Okay this program is really pissing me off! After line 95, the member variable is suddenly getting changed (That is, the 2nd string). Even after looking at it for 3 hours, I've failed to crack it :( Please help me out guys! [CODE] # include <iostream> # include <cstring> using … | |
Re: I would suggest you to read the chapter on pointers from your text-book before asking such questions here. These topics are covered in any standard books... Here is the syntax... [CODE] #include <iostream> using namespace std; void func(int array[]); int main() { int array[] = {10,20,30,40}; func(array); // func(&(array[0])); // … | |
Here is a very simple code demonstrating how 'protected' is used [CODE]# include <iostream> using namespace std; class A { protected : int a; }; class B : public A { public : void f_1() // * { a = 10; cout << a; } }; int main() { B … | |
Re: [CODE]#include<conio.h>[/CODE] This code hurts :O [QUOTE]I tried but could not find any other mistake which could have caused runtime error.. Can you please help!![/QUOTE] We here will not directly give you the answer. Check again. You'll find the error... Give us the new corrected code... | |
Re: [QUOTE]its so easy!!!![/QUOTE] It's the I-know-the-answer-but-I-won't-tell syndrome. It generally happens to people who suffer from I-don't-know-the-answer Don't be too hard on him... | |
Re: Wow! You're so close! Just fill in the last two functions and you're done. Then you'll see that you don't even need our help. You also need to attach the ass1.h file to your post and give proper code tags... | |
Re: Well, I'm a noobie but when I have to send an entire structure array, I just send the pointer to the 1st position of the array. Here is a sample code [CODE]# include <iostream> using namespace std; typedef struct AA { int a; }A; void print (A *struc_point) { cout … | |
Re: Dave, Will be [B]really[/B] missing you. Whenever I saw that Dave has replied to my post, it meant that my query has been solved. It's a shame that I couldn't know you better. All I know that you were a gifted programmer and a true gentleman, always polite and full … | |
Re: You know what, one could start a [U]Hall Of Fame[/U] for such posts like [URL="http://bash.org/?top"]Bash[/URL] We could show the new users what type of posts [B]not[/B] to make. | |
I've come across two questions from my previous years college test papers. I just couldn't solve them [LIST=1] [*][I]Define rational number as an ADT (abstract data structure)[/I] [*][I]Write a suitable C code to sort a finite set of elements where an element may appear a large number of times[/I] [/LIST] … | |
Re: If I ask you what does [icode]printf("Hello");[/icode] mean. You'll most probably say [QUOTE]It prints "Hello" on the screen[/QUOTE] but you didn't answer my original question about its...uh..."meaning" (which it doesn't have). You only stated its purpose. So please rephrase your questions If your questions were [QUOTE]What are the differences between … | |
Re: @aianne I would recommend you scrap that compiler (which supports non-standard header files) and get yourself a new one that supports C99 I would recommend [URL="http://sourceforge.net/projects/codeblocks/"]Code::Blocks.[/URL] | |
Re: Do you know this feature of characters in C? [CODE]char ch = 'A'; ch = ch + 1; printf("%c", ch);[/CODE] Output [CODE]B[/CODE] Now, you said ASCII code of 'A' = 65 & ASCII code of 'a' = 90, hence try to figure how much you should add/subtract from a character … | |
Re: What have you done so far? Could you show us that? | |
Okay, this time, i have to say it's a weird error. This code runs fine in Code::Blocks 8.02 but fails to run in my college compiler. I think my college compiler is the GCC Compiler (same as my home compiler) but in LINUX environment. Something like [CODE]vi sort.c cc sort.c … | |
Re: Are you trying something like this? [CODE] * *** ***** *******[/CODE] | |
Re: Are you trying to do something like this? [CODE]Enter The Number - 7 7 % 2 = 1 7 % 3 = 1 7 % 4 = 3 7 % 5 = 2 7 % 6 = 1[/CODE] Your for loop is a bit faulty. If you can correct that, … | |
Re: I just heard from a source that some systems treat [icode]return 0[/icode] as a "function gone wrong". So to avoid platform dependencies, one should use [icode]return EXIT_SUCCESS[/icode] Is this all correct? | |
Re: [QUOTE]Currently, i was assigned to create an array, [B]which i have no idea what array is[/B].[/QUOTE] Oh come on! Then I (along with several others) would suggest you to read your C Programming book before diving into such problems |