- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 4
- Posts with Downvotes
- 2
- Downvoting Members
- 3
I am an intelligent, super talented, fascinating, extraordinary, terrific programmer...and I love to lie at times !!!
- Interests
- Painting my mind...
- PC Specs
- Thumbs up for Open Source !!!
80 Posted Topics
Re: Your code is terribly indented :S...though it didn't look a starter's code... Anyways, I think you got the wrong brace at [B]line no 71[/B]. Always use [B]int main(void)[/B] as the standard main function call, with [B]return 0;[/B] at the end. Also don't use [B]conio.h[/B] as it is outdated (used for … | |
Re: You can also declare the structure variable at the main function and pass its reference as argument to the read() function. Just update the read() function as: [CODE]void read(struct matrix*);[/CODE] And use .(dot) operator at main function to print the values and use -> operator at the read() function to … | |
Re: Banfa told correctly, its far better to search for the occurance of // in the string. Here's a program for u... Note that I have considered the conditions and possible inputs given by u. That is I haven't considered inputs like [COLOR="Green"]"This is /my number //34"[/COLOR] ([COLOR="Red"]Single "/"[/COLOR] occurance) etc. … | |
Re: Do a "sprintf" to store the command string. Then use "system" call. Also file names given as command line arguments "argv" should start from index 1 to (argc-1). Make the changes and try again. | |
Re: Modify "input" function argument as (int a[10][10], int b, int c) and call it by input(a, m, n); or input(&a[0][0], m, n); That will do I suppose. | |
Re: Why are you storing all the characters and then getting the correct one from index, rather than storing the right one alone ?? | |
Re: You need to put a proper logic for finding the number of unmatched character. Try out these changes : 1. Combine the two names to a single one and logic will be much easier to implement. (say in an array 'str3') 2. Change the logic to find the unmatched characters … | |
Re: 1. Use if statements for replacing 'z' and 'Z' (recommended). 2. Check for characters falling under required series [Eg. (65 - 90) and (97 - 122) as in your case]. Everything else should be discarded. | |
Re: If the points are collinear, the sum of the distances between two pairs of points equals the distance between the third pair of points. | |
Re: Edit the /etc/rc.d/rc.local file and add a line to run the program with the actual path like : /home/sam/program (where program is the binary name) Otherwise, you can copy the binary to the /usr/bin directory (or a sym link will also do) and add only the executable name instead of … | |
Re: Why are you mentioning the value ${ppd_dbg} for one variable and not for the other {evd_comvar_debug}. Possibly that is making the ifeq statement false. Check it out ? | |
Re: Can you please put comments for all the calculation steps you have done. I think you will get your problem solved by yourself ! | |
Re: In my opinion, VMware is definitely far superior among all from a technical point of view as it is having the best feature support and great performance. QEMU, on the other hand, has the advantage of being a free software. VirtualBox lacks VMware's speed or features... So, one can get … | |
Re: Definitely, you are doing wrong with pointers. Your statement [CODE]myword[position].word = str; [/CODE] will make all the pointers to point to the same variable, which ultimately holds the last read word after the end of the loop. So, dereferncing any of the pointers (after the loop) will result in displaying … | |
Re: Good analysis Adak... But don't you think the thread is too old to congratulate..!!! | |
Re: U should be much more specific in what projects u r interested in, ur language capabilities, operating system etc. And what have u done in Multimedia/Animation in ur course that u opted for a project in it ??? | |
![]() | Re: Please post the problem area of your code for further help. |
Re: There are two different alternate sequences in your output. For the one with "ab", "abcd"....... sequence you can simply use a single character (ch = 'a') in loop like this : [CODE]for (i = 0; i < no_of_times_you_want; i++) { for (j = 0; j < i*2; j++) { printf("%c", … | |
Re: Read your post once before posting...if you coundn't get anything from that, how come others make it out ??? | |
Re: It is very easy to get your problems solved or doubts clarified with the thousands of knowledgeable programmers waiting to help you here in Daniweb, and that much difficult to get your homeworks done without showing any intention of learning or trying to solve by your own. Good luck !!! | |
Re: For your case, offcourse arrays will be preferred not because of efficiency but in design point of view. Proper use of data structures increases efficiency as well as maintainability of the code. | |
Re: Though evaluation of expression varies from compiler to compiler, but generally it will be from left to right. The evaluation of logical operation is done as per truth table, which suggests that for OR operation any one operand yielding to true results the expression to be true. So, only first … | |
Re: Hey, what is that ???:| I think not C language.....may be D, E or F... No, seriously !!! what is that ????:confused: | |
Re: If you are adding nodes at the head every time and want to print it reverse you can have a double linked list for the purpose, since you will have to traverse backwards. But its far more easy and convenient to add at the end of the list. Though I … | |
Re: The program accepts alphabets and maintains the count of occurance of each alphabet in one array (for all 26 letters). But the range of alphabets considered here does not differentiate between lowercase [a-z] and uppercase [A-Z] and thus converts the uppercase entries also to lowercase to make the calculation simple. … | |
Re: Its far far better to have an if-else ladder or nested if-else for the purpose (as mentioned by others) But still if you have to use switch, you can go for a nested switch construct like this: [CODE]int x = 5; switch(x > 5) { case 1: switch(x > 10) … | |
Re: You can try this for three numbers a, b and c : [CODE]printf("\nLargest among the three is %d\n", ((((a>b)?a:b)>c)?((a>b)?a:b):c));[/CODE] But there are other ways too....try to find out !!! | |
Re: You will get many threads regarding Final Sem projects in the Computer Science forum. Check it out... | |
Re: Oh boy...dont try to get back to him, coz he is too late to see your post..!!! :'( | |
Re: Yeah, a higher data type will solve the problem for you... Anyway you have done a mistake in the code. Your for loop counter should start from (x-1) and not x, as the value of x will be one more due to the last "x=x+1" statement at the do-while loop. … | |
Re: I think your problem is with having the functions in different files...right ??? So, post your code for the main function and the two max-min functions and we will help in the multiple file issue as the next step, only when you post your effort. So, go for it...Best of … | |
Re: As a simple solution you can try adding a flag for the purpose.... Add a global variable like : [B]int found = 0;[/B] and update its value once member is found. [CODE]if(t->data == num) { printf("\n\n The number is found."); found = 1; }[/CODE] and udate the Case 2 as: … | |
Re: Check with this thread: [URL="http://www.daniweb.com/forums/thread182010.html"]http://www.daniweb.com/forums/thread182010.html[/URL] | |
Re: AD, I suppose that is tripple pointer only... The last one indicates the notation of the cells, like menu-1 pointer-1, menu-1 pointer-2 and so on. Westony, why dont you try to frame the main function by yourself. Just simplify your task... Send the root address(indicated by "All" in your diagram) … | |
Re: Can you post the output for the program you get at linux command line... | |
Re: I suppose you are already aware of file read/write operations in C. You can simply put condition in the while loop which you are using for reading the file line by line, and print only the particular lines you want... Post your efforts for any help... | |
Re: Add the MinGW install path to the PATH environment variable. I suppose you are using Windows for your development. Then, right click [B]"My Computer"[/B] and go to [B]Properties->Advanced->Environment Variables[/B]. Add the MinGW installation path by editing the PATH variable. [COLOR="Green"][B]Ex:[/B][/COLOR] Add [COLOR="Red"][B]";C:\MinGW\bin"[/B][/COLOR] at the end of the existing [B]PATH[/B] if … | |
Shouldn't there be an indicator for the old threads that are bumped up to the top of the list only due to a fellow post ??? Though the date(or time) is already mentioned below the thread title, it generally get unnoticed and many used to post on it again. What … | |
Re: Yeah, you have done something with your assignment...now ask your doubts...!!! Suggestions : - Make the changes as AD told. - Use fgets instead of scanf for accepting the telephone number as a srting. - Don't use getch(), it is out of date. Use getchar() instead. - Use code tags … | |
Re: You are passing only 'n' (the total number) and not the actual integer array to the arguments of the [B]display [/B]function. What you are displaying now is the local array in the display function that contains only garbage. So, pass the array like you have passed in the [B]input [/B]function … | |
Re: Follow what AD has told. I just wanted to add up a bit more things... - Same as AD's second point you you can remove the variables in line no 21 and declare it inside the [B]converC[/B] and [B]converF[/B] functions as they are only use locally. - The checking you … | |
Re: I think you can use [B]gcc[/B] for the purpose along with flex... Check out the links below: [URL="http://alumni.cs.ucr.edu/~lgao/teaching/flex.html"][COLOR="Red"]Link1[/COLOR][/URL] [URL="http://dinosaur.compilertools.net/"][COLOR="Red"]Link2[/COLOR][/URL] | |
Re: Are you short of words or expressions or you can't type or the keyboard is not working or just not having enough time to properly ask your doubt's :icon_exclaim::icon_exclaim: And you are thinking that we are having a lot of spare time to not only solve and answer your questions … | |
Re: Change your logic to: [B]if (out_minute < in_minute) then minute = 60 - (in_minute - out_minute) and hour = hour - 1;[/B] You can better have one single function call for your time calculation, rather than calculating minute and hour separately... | |
Re: First of all, if its an already build project then further builds are going to give that message to you. So you need clean it with the [B]"Clean Project"[/B] option and then can build it again. Anyways, if you have done any changes to any source code then build option … | |
Re: Try the [B]system [/B]function call... It takes strings (your command) as arguments to it and runs that command at the console. So for your purpose, you can try this... [CODE]system("pwd >>file.txt");[/CODE] So, [B]pwd[/B] command will get the current working directory and >> will redirect the output and append it to … | |
Re: First of all, you have taken the search string wrong... It will be [CODE]char SearchText[]="#!/bin/sh"; // not "#!/bin/ash"...right?" [/CODE]...a silly mistake !!! Second thing is, still it wont work as fgets is taking \n together with the string you are reading as one line from the file. So, your [B]MainText[/B] … | |
Re: Hi Shikhin, Though it should not be a problem in searching for a bubble sort algorithm, but I am happy you tried it by yourself. Change the for loop as: [CODE]for(i=0; i<10; i++) { for(j=0;j<=9-i; j++) { if(a[j-1]>a[j]) { swap(&a[j], &a[j-1]); } } } [/CODE] I think your code will … | |
Re: I have not gone through your full code. But u can implement timeout for sockets using the [B]"setsockopt()"[/B] function as below : [CODE]struct timeval tv; tv.tv_sec = 60; /* 60 Secs Timeout */ setsockopt(sockid, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)); [/CODE] This you can do after your call to [B]"recv()"[/B]... | |
Re: You can use string functions to get the substrings for each part of the time and convert it into integer to store in your variables. Try this out: [CODE]ptrToYourStr = yourStr; for(i = 0; i < 3; i++) { time[i] = atoi(strndup(ptrToYourStr, 2)); //Taking the substring and converting to integer … |
The End.