519 Posted Topics
Re: Which kernel are you going to use ? | |
Re: One solution could be you could insert a '\0' /-1/some other invalid value after you are done inserting the numbers. Then in the function you can loop till you hit that invalid value | |
Re: I am not sure how helpful this will be but check out this [URL="http://www.google.com/search?q=c+programs+for+usb&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a"]link[/URL] | |
Re: Adding a little bit more information to gerard4143's post Open the file (Use fopen for this) Read the first line of the file and store it in a buffer (Use fread for this) Go through the line and check if the name of the country appears in the file or … | |
Re: Some more differences between C and C++ - C++ is more strongly typed than C Using the most cliched in C++ we have to typecast the value returned by malloc - I [B]think[/B] the maximum length the variable can have in C is limited to 32 chars. What I mean … | |
Re: Your code is hanging because of the for loop on line 70. From the looks of it I dont think you need the loop, so might as well delete it But from a conceptual point of view I cannot understand why loop runs on infinitely | |
Re: Objective C is quite different from C/C++ . It has lots and lots of quirks and it takes some time to get a grip on the whole thing I am not trying to discourage you but just sharing my personal experience with you | |
Re: [CODE]struct temp { char name[20]; }; struct temp t1[20]; int main() { strcpy(t1[0].name,"abhimanipal"); printf("%s\n",t1[0].name); return 0; }[/CODE] Maybe this will help you .... | |
Re: iPhone apps are usually written in Objective- C. You can use C++ in your objective -C programs but many of the common feature (constructors) are not allowed. Overall it makes way more sense to develop in Objective- C for the iPhone/ iPad platform Also iPhone does not support openGL. It … | |
Re: This is how I would do it [CODE]int calculateAverage(int* a, int startPoint) { for(int i= startPoint; i<startPoint+5;i++) //calculate the average and store it in sum return sum } int main() { int arr[30]={1,2,3...30}; for(int i=0;i<30;i++) average[i]= calculateAverage(arr,i); // Use some error handling for the cases when i becomes > 25 … | |
Re: There are some tutorials posted at the very beginning of this forum ... Check it out | |
Re: I used this reference for setsockopt [url]http://msdn.microsoft.com/en-us/library/ms740476%28VS.85%29.aspx[/url] According to this, setsock opt returms 0 for success. Change that part of code for your program. | |
Re: Did you compile the code ? Did you specify the name of the executable when you were compiling the code ?If not the default name is a.out | |
Re: RIP Dave..... I knew him slightly but I could tell he was a great programmer and more importantly now I know he had great spirit. To post on this web site despite having cancer. Respect. | |
Re: You want to compare the theoretical complexity or the difference in execution time for each of the algorithms ? | |
Re: Can you provide some sample inputs and outputs ? I am unable to understand what does palindrome and factorials have to do with the problem that you have posted | |
Re: This is a very brief answer to your question. For a more detailed answer try googling for it or wait for some one else to post it When a function is called the context of the current function (the contents of the stacks, the values in the registers etc, the … | |
Re: A simple rule of thumb is finish up all the expression to the left, then come and evaluate the expression to the right of the pointer For examples: v= *p++ Go left and de reference the pointer then come and increment the pointer | |
Re: What have you got so far ? Here is some thing to get you started [url]http://www.cs.cf.ac.uk/Dave/C/OLDC/subsection2_18_4_1.html[/url] | |
Re: Can you paste the content of the input file ? Also I do not understand the rationale behind the number 80 ?Can some one explain why the size of the temp buffer is 80 | |
Re: [QUOTE=kings_mitra;1274457]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 … | |
Re: Go over each char of the string stored in foo. If the char is a question mark, ignore it Else keep it Is the final product an integer or a char array ? | |
Re: The pseudo code for bubble sort is for i=0 to i<n { for j=0 to j<n-1 { if a[j] > a[i] then swap } } Check out the wiki link for bubble sort to get a more detailed explanation. | |
Re: What is the format of the numbers in your file ? Depending upon that you may have to do some string parsing .... | |
Re: c=product(a+2,b+1) will be expanded as c= 2+2*2+1 | |
Re: I have not programmed much on Turbo C, specially graphics.. But I have a couple of observations. I am 100% sure if these are indeed correct ... Please correct me if I am wrong [QUOTE=Ancient Dragon;1118283]>>when I tried to run it, it suddenly closed That's because there is nothing at … | |
Re: Read about thread wait and thread signal methods | |
Re: There are tons and tons of books, forums devoted to answer both of the above questions.... Did you try to do a google search on this subject ? | |
Re: The number 2 means that fgets will just read 2 chars from each line. You want to change that number to an appropriate size. | |
Re: @fxwebpage Really thats your advise. If your code is not compiling then there is some error in your code !!!! @melusim Is this your code or did you copy paste from some where ?There are so so many errors in it 1. You have declared the sort function in the … | |
| |
Re: According to your above post the function set_number_people is not defined to be a part of any class but yet when you call it, you use an object to call the function | |
Re: I think the type cast has to be done before applying the shift operator. Here is an example to show why [CODE] int main() { float f= 5.67; int x= (int)f<<2; printf("%d\n",x); return 0; } [/CODE] If f is not typecasted before applying the shift operator then the code will … | |
Re: If you have to insert data into a binary search tree, they get inserted into the tree depending upon their data values . So if my data is 10,11,12, My tree would be some thing of this sort 10 \ 11 \ 12 \ In such a scenario many of … | |
Re: fskeek can often give un predictable results when being used with text files. [url]http://www.cplusplus.com/reference/clibrary/cstdio/fseek/[/url] | |
Re: In the code for case 1, Your second record will over write the first one, third will over write the second record and so one. What you want to do is keep a count of how many records have already been inserted and then each time the user wishes to … | |
Re: Initial array is 1,2,3,4,5,6,7,8,9,10 After rotating it 3 times 8,9,10,1,2,3,4,5,6,7 | |
Re: When you create the current pointer in line 68, it is un initialized and points to some garbage location. So when you use it in line 75 it goes into an infinite loop. The solution to your problem is to initialize the current pointer when you create it | |
Re: The return value for the read and write system calls is the number of char successfully read/ written. Print that value and post the result here | |
Re: I do not think that your program is crashing.... This is what happens when you enter a char other than c. Since the char is not c, the code goes to the default case, prints "press c to continue" then comes out of the switch scenario and wait for you … | |
Re: I am sorry I did not understand what is your problem ?I ran the code that you have posted for 10! and I got the answer. So what is the problem ? These are the problems that I see with your code You have not checked for overflow. If you … | |
Re: Are you running your program from the Command Line ?Then a simple solution could be to run you program like this ./test >testfile The > operator works on Linux. You might have to use a different operator for your system | |
Re: [CODE]int main() { float f=10.5678; printf("%f\n",f); }[/CODE] Now if you want more precision when you are printing the floating point number google for print and you will find ways to do that | |
![]() | Re: Same solution as the one suggested by AD but you could use a map instead of a vector ![]() |
Re: @Aranarth Its a C- style approach. When we are program in C, all the variables have to be declared at the start of the function block | |
Re: Yes you can .... But you will have to figure out what are the ASCI values of the arrow keys In future start a separate thread for your questions. Even if you feel that your question is related to the current discussion | |
Re: Also what are you expecting to get when you do sizeof(argv[2]). It will give you the size of a pointer. Is that what you want ? |
The End.