- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 12
- Posts with Upvotes
- 12
- Upvoting Members
- 10
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
168 Posted Topics
Re: Well, the pesudo code should be converted to a code and then try with some test input. Well, YES, you cant just compile a pesudo code. So on what language are you suppose to implement the pesudo code. There are few tools which converts the pesudo code to code. But, … ![]() | |
Re: Here is sample code, which demonstrates on how to get a the ASCII code for the entered char. [code=C] #include <stdio.h> #define TRUE 1 void clear_buffer( void ) { int ch; while( ( ch = getchar() ) != '\n' && ch != EOF ); } int main() { unsigned int … | |
Re: HAHA what is Ant Clustering algorithm. Never heard of it before. But any way, no one is gonna give you the code unfortunately. People are here to help but not to pass on the code. Have you go any work on this algorithm that you on done? Post them here. … | |
Re: [code="C"] void printB( int num ) { if( num == 0 ) return; else { printB( num / 2 ); printf("%d", num % 2 ); } } [/code] You could solve the problem of you binary values printing in reverse using the recursive function. Have a look the function above. … | |
Re: Jobs you are in a right track. Thats right When do this [code] void foo(FILE *fp); in main foo (fp); [/code] When you call foo the address of the file pointer will be copies and sent to the foo function. If you wanted to send it through reference then you … | |
Re: Ok, try deleting your cookies and files. hopefully you should get you internet connection back again. This happenes quite often if you dont clear them for very long time. [code] Tools->Internet Option->Delete button-> <click> Delete cookies Tools->Internet Option->Delete button-> <click> Delete history [/code] Close down all your internet explore and … | |
Re: Until you indent you i dont think your going to get any help from here. Indent you code. I can’t compile this code as the code will never compiler. Python is strictly indent specific. I suppose you should know that by now. Indent your code and post again! ssharish | |
Re: I've never Django before, but straight getting into web develpment uisng some API would be off starting from far up than from the basics. I would suggest you to have a look on some tutorials on html create a few simple web pages and then try do some CGI scripting … | |
Re: [code="c"] GROUP *current = NULL; [/code] You have declared this current pointer and you havnt allocated memory for it and again in the groupcon function you are trying to derefrence the null pointer which is an undefined behavior. Allocate memory in the main and then tru current to the groupcon … | |
Re: Haha, here we have one more homeword thread? Dapsigar, show us a bit of progress on this assignment. You could expect some more help! ssharish | |
Re: [QUOTE]# include <stdio.h> is an "Unresolved inclusion"[/QUOTE] Have a look at this [URL="http://www.nabble.com/Unresolved-inclusion:-warning--with-CDT-5.0-(Ganymede)-td18404356.html"]thread[/URL], should be the same problem your facing as well. The GCC should have been confused on where the include files are located. I would really guess it shouldn't. but its worth a try! ssharish | |
Re: YES, you need to allocate memory for msg before you copy the string on to msg. Failing to do that will lead to a Segmentation fault. ssharish | |
Re: >My question is: If i'm the customer, how can i edit the quantity shown on the overview so that i can afford to pay the totalprice(if i've ordered too much) and delete some on the overview if i want to delete it(really short on money). Well, you can display all … | |
![]() | Re: You could also do something like this. Where you return the memory address of the allocate space in heap. [code] #include <stdio.h> int** allocate_matrix(int rows, int columns); int main() { int **table = NULL; table = (int **)allocate_matrix(3, 3); getchar(); return 0; } int** allocate_matrix(int rows, int columns) { int … ![]() |
Re: As everyone else had pointed out solution for, it better to you scanf function to read string or to reading anything at all. At least that my preference. But anyway, if you still used it make sure you flush the input stream before the second call of scanf function. The … | |
Re: Well I got to see how you call DeleteNode function. Is the node parameter to the DeleteNode function is a valid pointer to a strcut node? And in the Init function you create a new Person node and do you assign that it some other struct anywhere? And by the … | |
Re: [code] while((sizeof(struct player)) > 1) { for (j=0; j<k;j++) { /*count k-1 places around circle*/ current_player = current_player->next; } [/code] I dont really understand the logic here? Thats is gonna get into an infinite loop! You need to have a proper condition for while to exit. -ssharish | |
Re: And also this line is gonna print junk [code] printf( "\nInteger decomposition of %d is %d + %d + %d\n\n", n, a, b, c ) ; [/code] You might to return those i,j,k values back to main to print them accordingly. -ssharish | |
Re: This is quite messy; you might have start looking at some text on good programming practice. The few things which I could pick up from a quick glance are as follow 1. Main should return an int not void – MUST 2. Do not declare function within main. Would still … | |
Re: I would agree with AC, it is a crappy code, which dosnt follow any standard. If you still say that a valid code, then have a look at this [code] MyLL * first; MyLL * last; [/code] What is MyLL. Is it typedef ? No! ~ssharish | |
Re: '.' is the operatir which you are looking at. '->' is the operator which you need when you dereference the struct pointer variable. Like for an example [code] struct node { int data; } struct node *d; struct node d1; printf("%d\n", d->data); // you could also use (*d).data here. The … | |
Re: >regardless of whatever stores at a shouldn't it produce -2. I dont really see why do you expect those values. When you dereference a, you will get junk jusy because you haven't initialised it. When you didthis *(a+1), it was getting the address of a thats the base address and … | |
Re: I can write a big list of comments on your code. But i dont have time for that. But just a quick review you are using quite a lot of non standard function and libraries. What compiler are u using? But over all good code. ssharish | |
Re: Well, Turbo C is a very old compile which is no more support. Why dont u use some standard compile. I can understand that you on a windows environment. I would really sugguest to change compile which you trying to use to Dev-C++. It is pretty good and it good … | |
Re: [QUOTE=PRATS 1990;830719]I HAVE A VERY PECULIAR PROBLEM,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, THE PROGRAMS I COMPILE SHUT DOWN AFTER COMPILING ONCE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, FOR EG- I CREATED THIS PROGRAM FOR GETTING THE ASCII CODES OF AN ALPHABET ,,,,,,,,,,,,,,,,,, AFTER I WROTE THE ALPHABET IN DOS IT DISPLAYED ITS VALUE AND SHUTDOWN,,,,,,,,,,,,,,,, HOW CAN I ALTER MY PROGRAM … | |
Re: Well, there are certain ranges that the bluetooth can cover according to the standard. There are two type class1 (covering 100m) and class 2(covering 10m). I suppose you can try experiment those range as you keep moving away. well, increasing the range of the bluetooth is possible and the Bluetooth … | |
Re: Well, it donst make any sense of the input file that your trying to read with regards to the student grade information. If I was you, i would go your lecture and speak about on how the input file should be read. And how the file had been formatted with … ![]() | |
Re: >how do i save the c programs i compiled on borland c++ on the dekstop??????????????????????? Well, when you compile the C code you would the binary or the .exe file out of it. Unless you have any errors. Assuming that your program compiled with no warning or errors, the .exe … | |
Re: >Please suggest the addValue definition to accommodate this change Looking at the way you call the function. The function definition should look like: [code=C] void addValue(struct Info **info, char *value, int posVal); [/code] So that's the function addValue which takes pointer-to-pointer of struct Info type, char pointer and an integer. … | |
Re: [QUOTE=vinitt88;828431]Hi, I am trying to develop a DOS-like system which will be able to do all minor functions like cd.. cd/ and changing to sub directories. Guys I am stuck in how to find a single path for many files..... Thanx in ADVANCE[/QUOTE] Well, if you are trying to executing … | |
Re: [code=C] /[.].*\(15\).*\(53\).*\(92\).*\(=>\) [/code] This would still wouldn't give you the right answer? Its expecting all the search charcters to be in the same line. Look at nucleon post. -ssharish | |
Re: >Well, I was rewriting it to GLUT anyway. Thanks for the trouble. Suggestions on how to improve the above code are still welcome of course... Perhaps, placing all your macros definition at the top the code would make it more be neat and professional. That was from a quite glance. … | |
Re: Use sprintf function to convert int to string. Thats the more portable way of doing it. Since itoa is not portable! [code="c"] char *cvtInt( char *str, int num) { sprintf( str, "%d", num ); } [/code] ssharish | |
Re: [QUOTE=ahamed101;700767]Hi ArkM, How else can we clear the input stream?... I think the issue with the above code is basically the input stream is not cleared... I also read that the usage of fflush for stdin is undefined... Regards, Ahamed[/QUOTE] Use this instead [code="C"] void clrInputBuf( void ) { int … | |
Re: [QUOTE]t=(NODE *)malloc(sizeof(NODE));[/QUOTE] Why the hell would you cast the malloc. You shouldn't do that! Read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351"]this[/URL]. @OP for me most of of the things seems to be fine, except the head node pointer deferenceing like it has been mentioned by others already. Unless you've got your head node like this … | |
Re: Perhaps you should make an effort to search on the form. There might be like tons of results on this issues. But here is the pesudo code. [code="] <return type of int> function name FACT ( taking int as an argument ) { if n equals to zero return one; … | |
Re: [QUOTE]filetype = ????; [/QUOTE] So if the flag matches, you can get the argument by the global variable optarg. That should hold pointer to the argument which you are looking for! [code="c"] filetype = optarg; [/code] ssharish | |
Re: Look at the ncurser library, that should give much control the console window. So that you could move your cursor around to locate the value on the screen. I assume your working on Linux/UNIX platform ;) ssharish | |
Re: Here is a [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048384015&id=1043284392"]link[/URL] which could give you some hint!!! ssharish | |
Re: [QUOTE=omdnaik;700383]Hi frnds, i have been programming for abt a yr now n used to consider myself gud wid c programming until i chked out this forum.... [/QUOTE] Huh??? If you been programming for an year and you seem to consider a good programmer. But still you are not that confident … | |
Re: As I can see, you are calculating the X axies values right, but not the Y axies values. Which dont incrment the values a bit more in the Y axies values to suit your requirnment. The following is the bit og your code which you need to cocentrate on [code="C"] … | |
Hello everyone, I finished my graduation degree 2 months before and I was in the process of applying for a job. It been two months now. I just had three interviews. Its so frustrating. Why would I get a job. Can anyone give me some advice on why does it … | |
Re: What I can understand, is that your are looking for something called Infix to postfix expression. And then solve or evaluate the postfix expression. The postfix expression can be evaluated very easily using a stack machine. Have a go researching on Postfix evaluation algorithm. Thats should probably get you in … | |
Re: Hmmm seems like that need to implement a lexical and a syntax analyzer. Have a look at compiler design concept. ssharish | |
Re: You dont have to have such a huge list if and else to do this. You to reduce that to just few lines of code. Looks the my version of convert function. [code="C"] int convert( char *str, int *number ) { int i; for( i=0; str[i] != '\0'; i++ ) … | |
Re: [code="C"] scanf("%d", &miles); [/code] You need to read double here. But you are reading integer. Or at least change the type of miles here to integer. You might actually expect some meaningful result. And you have an infinite loop in your code. Your program will keep requesting for miles every … | |
Re: It looks like that he might have his own SDL and API by the looks of it. @OP - What does this code do? ssharish | |
Hello all, Can any one explain me whats the main different between them two data structures. I have been like working on them quite lot now. When do we use tuples and when do we use list. Any specific explains are much appreciated. Thanks a lot ssharish | |
Re: LOL you've opened a thread which is like two years old now. The OP might have already solved this problem by now. Perhaps, he might have got a far better knowledge than what he had when he started this thread. And you post what information does it gives him anyway???? … | |
Re: what i can see here is that you mobo might be with some problem. From what your saying. but not really very sure. Well what does the hard driver motor starts up when you boot your machine? Check all other componets from your this machine with the different machine and … |
The End.