- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 7
- Posts with Upvotes
- 6
- Upvoting Members
- 7
- Downvotes Received
- 10
- Posts with Downvotes
- 8
- Downvoting Members
- 8
- Interests
- Geeking...
- PC Specs
- Intel Core 2 DuoT7520 Processor2.0 GB RAM160 GB HDD8x DVD RW +/-8400 nVidia 128 MB Graphics Card
73 Posted Topics
Re: [QUOTE=devh;697232]Hello Every Buddy.. My Problem is solved.. I was unable to send data from my C program for that I hav to make some small changes in My Serial cable.. I had make it NULL MODEM... Just Short 4-6 and 7-6 pin It will start sending as receiving...[/QUOTE] Hey can … | |
Re: Check this [url]http://www.daniweb.com/forums/thread147417.html[/url] and [url]http://www.daniweb.com/forums/thread148447.html[/url] It should help you out | |
Re: Hi, If you just want to read a string with space termination, you could just use scanf... If you want to print the read characters, just find the length of the string read and print it... You said the user input is arbitrary, in that case you can do 1) … | |
Re: Try this dd="20130409" date -d $dd -d "next monday" +%Y%m%d --ahamed | |
Re: Hi Just "Press Enter" after the last curly braces. you must be using vi editor. Some compilers show this as warning. | |
Re: This code will given an run time error only if you have miss "&" in the scanf section...Please check your actual code if you have the &A[i] and not just A[i] in the scanf section... | |
Re: [QUOTE=joelogs;711581]we are given the assignment to implement the banker's algorithm in c. this implementation must run in the linux terminal and program must be utilized the os in the time of execution. this means that it must capable on real-time execution with the os. i really don't have any idea … | |
Re: fflush(stdin) is commonly used by everyone in their code to flush the input stream... even i was also using that until Salem and some others from this group corrected me... fflush(stdin) will work most of the time but it is not all recommended to use that... if you want to … | |
Re: Hi there... If you are using Eclipse on Windows then read below... For windows, you should download eclipse-[B][U]cpp-ganymede-win32.zip[/U][/B] from [URL="http://eclispe.org"]http://eclispe.org[/URL]. This comes with a inbuilt gnu compiler (gcc etc)... If still you are not able to compile please install MiniGW from [URL="http://minigw.org"]http://minigw.org[/URL]... This is free gnu compiler... Further if you … | |
Re: Just modifying Sci@phy's code... [code=c] while ((string[i++] = getchar())!='\n' && i < SIZE); string[i]='\0'; [/code] This will do the trick... | |
Re: You know it’s love when you memorize her IP number to skip DNS overhead If at first you don't succeed; call it version 1.0 -- i think we can call it beta version also right?? :D:D lol nice ones... | |
Hi All, Let me explain the problem. I have multiple include files as in class1.inc, class2.inc, class3.inc etc. Contents of an include file will be like class1.inc [code=c] { "john", 12, 68, "steve", 12, 98, "mat", 12, 95, }; [/code] This will basically serve as a static array of structures. … | |
Hi All, I am trying to write a common function called call which will take in a void* and an int type. Based on the int type it will have access to different structures. The code doesn't compile in the first place. I am not sure this is correct or … | |
| |
Re: fgets is always safe... cause in fgets we can specify the size of the string that should be read... in such a case we can be sure only the specified no of bytes will be read... gets is not like that... it will read whatever we give and may overwrite … | |
Re: This part is wrong... [code=c] if (a==0 && b==0 && c==0) { opselect = 1; else if (a==0 && b==0 && c!=0) opselect = 2; else if (a==0 && b!=0 && c!=0) opselect = 3; else if (sqr < 0) opselect = 4; else if (sqr == 0) opselect = … | |
Re: Check [URL="http://www.math.lsa.umich.edu/courses/389/Projects/triangular_arrays.pdf"]this[/URL] | |
Re: Yeah!!! True... the most complicated code we write should not be commented... It should be a piece of wonder and mystique for others... | |
Re: [QUOTE=GrimJack;710087]Dang, I must be noob - I don't know you but welcome back anyway.[/QUOTE] Yeah me too... dont know you... welcome back anyways... :P | |
Re: What is your problem anyways... No clue... seriously... one thing we know, you got a problem for sure... be more specific buddy... | |
Re: First thing first... You want to calculate the age of a particular user, why do want an array for that?... Second... [code=c] /* Function Prototype */ int calAge(int currentYear[],int currentMonth[],int currentDay[],int birthYear[],int birthMonth[],int birthDay[]) /* Function Call */ calAge(currentYear[i],currentMonth[i],currentDay[i],birthYear[i],birthMonth[i],birthDay[i]); [/code] The above function call and prototype does not match... In … | |
Re: You can clear the input buffer also... use something like this... [code] char ch; while((ch = getchar())!= EOF && ch != '\n'); [/code] I hope Aia doesn't shout at me for the code I have given here... :D... cause you all know there was a small talk over this code... … | |
Re: Bottom line... you don't have graphics.h/the compiler doesn't know... Dev-cpp does not come with graphics.h... [URL="http://www.daniweb.com/forums/thread17709.html"]Read this[/URL] thread... | |
Re: One thing is you need to reallocate memory dynamically... As you say calling realloc always for small data size ain't a good idea... In such a case you can allocate chunks of memory at time... like 32 bytes, 64 bytes, 128 bytes and so on... whenever your data exceeds the … | |
Re: [QUOTE=nishant3316;714794]Yes.. i saw that... May be before you're rude to people you should give some thought to the fact that programmers aren't the best when it comes to communicating and MAYBE the language they use is a bit obtuse for a greenhorn to understand. It's quite easy being condescending when … | |
Hi, For last one week I have been trying to do conversions between UTF8, Multibyte, Wide Character and Ascii... Finally managed to code a working program... Thought this might help some one, so posting it here... If there are any errors, please point out... If you have any doubts please … | |
Re: [QUOTE=RouseA;705752]I have been programming in C for many years, but I have just started using GCC/Eclipse for a new project to develop a product using an embedded ARM processor. I have found a problem that hasn't existed in previous C compilers I have used: I have created a define as … | |
Re: Please find the comments inline [code=c] #include <stdio.h> int main(int argc, char *argv[]) { int g[] = {-1,1,3,7,2}; /* g is an array of integers */ int *x = g; /* x is a pointer to integer that points to the array g(basically to the first element) */ int y; … | |
Re: So what is your doubt anyway... :D "I was wondering if realloc() copied the contents of the block of memory to the new block"... The answer is NO... realloc only increases the size of the previously allocated memory... | |
Re: 1. take the first three numbers(which you have already done) 2. find their squares... a*a, b*b, c*c store them in the same variable 3. sum them, a+b+c 4. Divide by n That simple... :) | |
Re: [QUOTE=Jayaprakash.BS;712849]Hi, I want to read .wav file from the any directory in windowsXP and draw the graph of that particular file using C or C++ code.. Can anyone help please?????[/QUOTE] How do you intend to do it?... Give us your logic and come code snippets... | |
Re: Hi, this code is tooooo big to analyse... tell us whats the issue you are facing(be specific) so that we can help you... | |
Re: [QUOTE=rrreeefff;709691]Hi I am working on a program that computes the sum of N in increments of 3. I do not have any errors but when you run the program it does not compute correctly for example if you enter 2 for n the sum should be 5 [code=cplusplus] #include "stdafx.h" … | |
Re: Also, argv is of type char**... so use strcmp to compare the strings... | |
Re: You are missing the "i" increment in the while loop... [code] while(loop!=EOF) { printf("%s %s %s %s %d\n",factory_info[i].machine,factory_info[i].employee,factory_info[i].date, factory_info[i].test_value,factory_info[i].qualification_rate); /* You must increment i */ i++; loop = fscanf(data_txt,"%s" "%s" "%s" "%s" "%d",factory_info[i].machine,factory_info[i].employee,factory_info[i].date, factory_info[i].test_value,&factory_info[i].qualification_rate); } [/code] | |
Re: You can read and write simultaneously like Sci@phy suggested... 1. Open file 1 in read mode 2. Open file 2 in append mode 3. read from file 1 4. do the processing 5. write to file 2 6. continue from step 3 till end of file of file 1 7. … | |
Re: what is the series all about... is there any general formula for this?... give an example... like if n =3, output should be?... | |
Re: the function name is different... the prototype has celsiusAtDepth and the definition has celsiusAtdepth... [code=c] float celsiusAtDepth (float); float celsiusAtdepth ( float depth) [/code] | |
Re: You need to flush the input buffer before you get the next input... [code=c] ... printf("\n ENTER OPERATOR SIGN : "); char ch; while((ch = getc(stdin)) != EOF && ch != '\n'); scanf("%c", &operation); ... [/code] And you are missing %d, add that else you will not get the answer... … | |
Re: Use continue instead so that you can enter the salary again... [code=c] i = 1; while(i <= numb_salaries){ printf("Enter salary #%i: ",i); scanf ("%i", &salary); if(salary < 0){ printf("\n Please enter a valid salary...\n Press enter to re-try..."); fflush(NULL); getchar(); continue; } sal_total = sal_total + salary; i++; } [/code] | |
Re: Hi, When I used scanf instead of scanf_s, it printed the output properly... I am not aware of scanf_s... googled it and found it out its some secure version of scanf or something... i use unix and this is available only for MS C I guess... [code=c] scanf("%d %d %d … | |
Re: this is wrong... you are missing one "%d" [code=c] scanf("%d",&a,&b); [/code] corrected code [code=c] scanf("%d %d",&a,&b); [/code] This is also wrong... [code=c] printf("d%d,a,b\n"); [/code] Corrected code [code=c] printf("%d %d\n",a,b); [/code] |
The End.