1,088 Posted Topics

Member Avatar for Brent

Copy and paste anything that you have saved in C as yours, usually in C:\Document and Settings\<UserNameHere>, to F:\>. You can transfer My Documents to F:\ But you can not transfer anything belonging to the operating system or applications installed already. You can un-install programs and install it again in …

Member Avatar for gerbil
0
337
Member Avatar for pusangkinalbo12

You forgot to tell us how soon do you need it? [URL="http://www.daniweb.com/forums/announcement8-2.html"]Click me.[/URL]

Member Avatar for Aia
-1
45
Member Avatar for yeboah

Welcome over here, yeboah. [QUOTE=yeboah;666477][...]please l want to get control of my computer[/QUOTE] Then, push the turn off power bottom in you computer. Just kidding. Again, welcome.

Member Avatar for sittas87
0
75
Member Avatar for Y_Game

Your program says I can pick from between 1 and 100. What would happen if I pick 6 or 12 or any thing below 50? Probably I'll get old clicking that darn n (no) key. Next time use [URL="http://www.daniweb.com/forums/thread93280.html"]proper tagging[/URL] to post your code. [edit:] You have a problem here …

Member Avatar for Aia
0
133
Member Avatar for sting_010

Oh, dear, dear. Where's your effort on the matter? No posted code showing what you have tried already towards the assignment; no help you'll receive, I am afraid. It is not my rule, it is [URL="http://www.daniweb.com/forums/announcement118-2.html"]the policy[/URL] of this board.

Member Avatar for Salem
0
200
Member Avatar for the reaper

[ICODE]fflush(stdin); //fflush statements are used thoroughly through[/ICODE] [URL="http://www.gidnetwork.com/b-57.html"]Should not be used at all.[/URL] [CODE]scanf("%c", &key); //the loop and for the "exit" function[/CODE] scanf() has many [URL="http://www.gidnetwork.com/b-60.html"]"gotchas"[/URL] that will throw your logic for [URL="http://www.gidnetwork.com/b-63.html"]a spin[/URL]. You can start reading some of these series. [URL="http://www.daniweb.com/code/snippet266.html"]Read an Ingeter from user.[/URL] [URL="http://www.daniweb.com/code/snippet357.html"]Read a Float-point …

Member Avatar for WaltP
0
260
Member Avatar for mjoshi

[QUOTE=kvvaibhav;665143]How do we pass float/integer arguement to a C program from the commandline, if argv is a character array ??[/QUOTE] You take that string and convert it to a particular value using some of the Standard C functions like strtol for long integer or strtod for double, etc... and then …

Member Avatar for Aia
0
417
Member Avatar for jess29

[CODE]char *replace(char string[COLOR="Red"][100][/COLOR])[/CODE] And now something extra. You don't need to care how long the string passed as an argument is. You can write it like [ICODE]char *replace ( char string[] )[/ICODE] or even like [ICODE]char *replace( char *string ).[/ICODE]

Member Avatar for jess29
0
111
Member Avatar for coolkeg

[QUOTE]Error E2379 keelan.c 15: Statement missing ; in function main Error E2379 keelan.c 17: Statement missing ; in function main Error E2379 keelan.c 19: Statement missing ; in function main Error E2379 keelan.c 21: Statement missing ; in function main[/QUOTE] [CODE]if(operator == '+') sum = number1 [COLOR="Red"]'+'[/COLOR] number2; else if(operator …

Member Avatar for Aia
1
128
Member Avatar for Salem

[QUOTE=VernonDozier;662164][...] What else is this database used for besides conducting 6 degrees of separation studies?[/QUOTE] Main purpose is to learn how to better tailor targeted ads to you and yours. Now the possibilities for other uses are limitless, or I should say; limited only by their imagination. I leave to …

Member Avatar for jwenting
0
92
Member Avatar for Aia

I like to read the signature of my fellow Daniloggers. Some are funny, some are inspiring, some just make me think... what in the world? It is in the thinking part that I engaged when I read this morning the signature of one of our elderst posters. In [URL="http://www.daniweb.com/forums/member.php?find=lastposter&t=129399"]Ancient Dragon[/URL] …

Member Avatar for Aia
0
761
Member Avatar for abhisdm

Name putw() to something different like putword(). Most likely there's an implementation of putw() already prototyped in your compiler library. Please, make sure you use proper tags when you post code next time. [URL="http://www.daniweb.com/forums/thread93280.html"]Here's how.[/URL]

Member Avatar for ArkM
0
154
Member Avatar for dummy programer

Exactly, where are you having problems with? Be more specific and post relevant portion of code you have tried already and it is not working.

Member Avatar for dummy programer
0
72
Member Avatar for acchao

[ICODE]hex_test = (char*) malloc (sizeof(char));[/ICODE] [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351"]Don't need to cast malloc in C[/URL], in fact no need to allocate memory for just one byte character. If all that you need is a char declare a char. [ICODE]while(!feof(fp_readBin)) [/ICODE] feof should never be used as a control statement. [URL="http://www.gidnetwork.com/b-58.html"]It doesn't work correctly.[/URL] …

Member Avatar for Adak
0
240
Member Avatar for Clockowl
Member Avatar for plike922

>I cant find anything wrong with my program, any suggestions? Then, it would appears that most of the necessary steps to correct your program would be over your head. This is not a reason for discouragement, it just says that you need to learn some more. Starting with switch, [URL="http://www.cprogramming.com/tutorial/c/lesson5.html"]read …

Member Avatar for @bhi
0
195
Member Avatar for DanDaMan

Some reading examples[URL="http://en.wikipedia.org/wiki/Header_file"] here[/URL], [URL="http://gcc.gnu.org/onlinedocs/gcc-4.3.0//cpp/Header-Files.html"]here[/URL] and [URL="http://www.nongnu.org/c-prog-book/online/x307.html"]here[/URL].

Member Avatar for DanDaMan
0
160
Member Avatar for aannjjaallii

[QUOTE=shankhs;658728]Pretty harsh reply by AncientDragon [...][/QUOTE] Harsh? That is not being harsh. That's practicing at being a jerk without style and heavy on the unoriginal side of the trend. After all, it wasn't very long ago that they used to write “RTFM”. And no; the F doesn't stand for Read …

Member Avatar for iamthwee
0
122
Member Avatar for fatasscp

[iCODE]sscanf(line,"%[COLOR="Red"]3[/COLOR]f[COLOR="Red"]2[/COLOR]", &limit);[/iCODE] remove red part [iCODE]scanf("%[COLOR="Red"]3[/COLOR]d[COLOR="Red"]2[/COLOR]", &x);[/iCODE] do same here. [iCODE]printf("[COLOR="Red"]%3f2\n[/COLOR]", a[n]);[/iCODE] substitute for [COLOR="Green"]%.2f\n[/COLOR]

Member Avatar for me_roy
0
189
Member Avatar for plike922

You are loosing precision. For percentages you need to use floating points.

Member Avatar for Ancient Dragon
0
122
Member Avatar for sinner

[QUOTE=Prabakar;656893] 2) malloc returns a void pointer which needs to be type-casted. [/QUOTE] In C programming, casting malloc it is asking for problems. Include the header file stdlib.h to avoid compiler warnings. Read more about it [URL="http://cboard.cprogramming.com/showthread.php?t=25799"]here[/URL].

Member Avatar for Aia
0
110
Member Avatar for plike922

In main: [CODE]int result; result = GCD( n1, n2); printf("result = %d\n", result);[/CODE]

Member Avatar for Prabakar
0
180
Member Avatar for flecture

[QUOTE=Adak;651069]This isn't the place for "can you tell me about some feature of C".[/QUOTE] Since when? [QUOTE=Adak;651069] [...] and we don't have the time to be unpaid tutors. [/QUOTE] Speak for yourself, I would say. I do not restrict information of the knowledge I have been given by others. I …

Member Avatar for Ancient Dragon
0
247
Member Avatar for sinkingships7

Perhaps? [code] index_s1 = strlen(num_s1) [COLOR="Red"]-1[/COLOR]; /* needed for offset of subscript zero */ /* remove the = part of <= */ for (index_s2 = 0; index_s2 <[COLOR="Red"]= [/COLOR]strlen(num_s1); index_s2++){ num_s2[index_s2] = num_s1[index_s1]; index_s1--; } /* don't forget the '\0' terminator */ [COLOR="Red"]num_s2[index_s2] = '\0';[/COLOR] } [/code]

Member Avatar for sinkingships7
0
121
Member Avatar for sinkingships7

Take a look at the function [URL="http://www.cplusplus.com/reference/clibrary/cstdio/sprintf.html"]sprintf()[/URL]

Member Avatar for sinkingships7
0
119
Member Avatar for kuratkull

[CODE]void render(void) { int loop; #pragma omp parallel shared(loop) { #pragma omp for for (loop = 0; loop < 100; loop++) { printf("DIE\n"); _flushlbf (); glVertex2f(loop/50.0,loop/50.0); } } glEnd(); glFlush(); } [/CODE] Invoking glVertex outside of a glBegin/glEnd pair results in undefined behavior. [B][Edit:][/B] Some samples perhaps: [URL="http://www.thepcspy.com/read/opengl__shapes_and_colour"]Click here[/URL]

Member Avatar for kuratkull
0
327
Member Avatar for RaDeuX

>Well it technically still works, Serious trouble ahead if you really think so. [ICODE]char* pStrings[10];[/ICODE] There are 10 pointers to char there, but none has been initialized to a chunk of memory. First is necessary to set aside some memory for each pointer to point to, using the function malloc. …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for flipjoebanana

Regardless of any other logic flaws, I would like to point to some of them. [CODE]void process_input(FEELING *ex_1) { char line[200]; char *pstr; int count=0; fgets(line,[COLOR="Red"]201[/COLOR],stdin); /* line can only hold a buffer of 200, there's opportunity for overflow because of that 201 */ ex_1->num = -1; pstr = strtok(line," …

Member Avatar for dwks
0
249
Member Avatar for trowa0830

[QUOTE=trowa0830;648302]thanks sir.. but now i need another help i want a prgram that continuosly adds the number input then displays the sum when 0 is pressed. all i have is this old code for adding the sum.[/QUOTE] Perhaps you are beyond help. [URL="http://www.daniweb.com/forums/post644509-2.html"]You have been shown some good professional programming …

Member Avatar for Aia
0
289
Member Avatar for Anbuvengeance

[QUOTE=Adak;647448]Line 571 has this code: [code=C] printf("Edit this record?(Y/N)"); scanf("%s", answer); if(strcmp(answer, "Y")==0) [/code] Which I believe should be changed to: [code=C] scanf("%c", &answer); //answer is a char, not a string if(answer == 'Y') //note the change to a single quote for a char, instead of double quotes etc. [/code] …

Member Avatar for Anbuvengeance
0
91
Member Avatar for shriagni

[quote=shriagni;353288]dear Ancient Dragon ,[/quote] You want to make Ancient Dragon happy?. Learn [URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]here[/URL] how to properly tag the code you post. [quote=shriagni;353288] i think this is code as u explained to me so i tried out the code not sure which to print out so printed out all the results. …

Member Avatar for Prabakar
0
279
Member Avatar for lAmoebal
Member Avatar for sambafriends

[QUOTE=sambafriends;623259]Thank u very much for this, Why we are putting getchar() again If it is not what happening there please give me reason[/QUOTE] My guess: getchar() only reads one character at a time from the standard input buffer ( stdin ). However by virtue of the nature of the buffer …

Member Avatar for manavsm
0
163
Member Avatar for moogle1979

>How to I get the loop to repeat and not accept a character so I can prevent the infinite loop? By ditching the use of scanf() to read input form user. Here's the start of [URL="http://www.daniweb.com/code/snippet357.html"]alternatives[/URL] on how to read a floating point from user.

Member Avatar for moogle1979
0
319
Member Avatar for Panache

[QUOTE=Panache;629420]I recently had a computer which suddenly lost support for its CD drives. The original was an IDE drive and so i tried a SATA and even an external USB cd drive. None would be recognized by the pc. It would say "found new hardware" but never given a drive …

Member Avatar for sittas87
0
196
Member Avatar for Alex_

How's t and t2 declared? [ICODE]FILE *fp=fopen("element.txt","rw+");[/ICODE] How about checking that the file was opened? [CODE]if ( fp == NULL ) { <error...> }[/CODE] Upon success fread() returns the amount of elements read in a form of size_t object; why don't you check that? [CODE]size_t result = 0; result = …

Member Avatar for Alex_
0
912
Member Avatar for mayu
Member Avatar for jephthah
0
2K
Member Avatar for grvs

[CODE]int * readArray(int size){ int *A = malloc ( size * sizeof *A ); int i; for (i=0;i<size;i++){ printf("\nEnter the element no. %d: ",i+1); scanf("%d",(A+i)); } // [COLOR="Red"]free(A); [/COLOR]this when uncommented cause the first element to be zero, makes sense, but // why other values are not lost [COLOR="Red"]return A;[/COLOR] …

Member Avatar for grvs
0
5K
Member Avatar for grvs

>And about C hat and C++ hat, I'll Google and see what they are. Don't waste your time doing that. What Salem was trying to convey was that people has the tendency to write C/C++ implying that it is, somehow just a programming language. When indeed C is not C++, …

Member Avatar for grvs
1
728
Member Avatar for abhijithda

'\n' is not the same than "\n", the first is a newline char the second is a string that contains '\n' and '\0'. Same with any other [URL="http://www.wilsonmar.com/1eschars.htm"]escape characters [/URL]you mention. [ICODE][COLOR="Red"]Printf([/COLOR]"\naa\b\n")[/ICODE] is not the same than [ICODE]printf( "\naa\b\n" );[/ICODE] [ICODE][COLOR="Red"]Printf[/COLOR]("\naa\bc") [/ICODE] '\n' can be used any where inside a …

Member Avatar for jephthah
0
265
Member Avatar for awi123

[QUOTE=Salem;626102]So what's YOUR question? Mine is "Why haven't you read the intro posts on how to use code tags?"[/QUOTE] Tricky question Salem; hard to answer. Could you make it a multiple choice one? [QUOTE] [B]a)[/B] Because I am too busy to read any rule and beside, they are not that …

Member Avatar for Aia
0
113
Member Avatar for dlnunez99

Missing [COLOR="Red"]"[/COLOR] before $exit until [ "$answer" = [COLOR="Red"]"[/COLOR]$exit"] ; do . . . esac [COLOR="Red"]done[/COLOR]

Member Avatar for Aia
0
118
Member Avatar for narendharg

[QUOTE=jephthah;624672]"FLOAT CODE" is meaningless. [/QUOTE] You wouldn't think the same if some of your code made you `sink down' to the bottom of the pit of desperation. ;)

Member Avatar for Aia
0
133
Member Avatar for achandra

#include "name.h" the compiler looks first in the current directory. #include <name.h> the compiler looks in the default path where the libraries for it are installed. When the programmer do not want to mix header files own made with the standards that came with the compiler, usually it sets them …

Member Avatar for jephthah
0
64
Member Avatar for hazmatt

[ICODE]opt_httphost = argv[0] + 7; //+ 7 removes http://[/ICODE] Nope, argv[[COLOR="Red"]0[/COLOR]] is a pointer to the beginning of the string that hold the name of the program being execute. Given [ICODE]char *opt_httphost;[/ICODE]: [ICODE]opt_httphost = argv[[COLOR="Green"]1[/COLOR]] + 7;[/ICODE] might put you at the beginning of the name address as long as …

Member Avatar for hazmatt
0
128
Member Avatar for dobado

[QUOTE=dobado;619330]i didnt really get what u r saying but what i need is to write a c prog that return the number of solution for a given n[/QUOTE] Yeah, he has a heavy English grammar, very hard to understand, specially for people like you that try to be up to …

Member Avatar for tesuji
0
126
Member Avatar for MiTiM

[ICODE]if ( fscanf(fin, "%[COLOR="Red"]l[/COLOR]f %d", &fnum, &inum) == 2 ) {[/ICODE] If you are reading into a double you need to let fscanf know by appending a l ( that's the letter `L' ) between % and f [ICODE]if ((fptr = fopen(filename, [COLOR="Red"]"wb+"[/COLOR])) == NULL)[/ICODE] That will erase any data …

Member Avatar for MiTiM
0
2K
Member Avatar for somename

[QUOTE=somename;618096] [CODE]char time; // or int time; time = [COLOR="Red"]"10"[/COLOR]; sleep(time);[/CODE] [/QUOTE] This is the prototype of sleep: [ICODE]unsigned sleep(unsigned seconds);[/ICODE] Meaning it accepts an unsigned type argument and returns an unsigned type [iCODE]int time = 10;[/iCODE] will work correctly as long as time is an unsigned integer. [ICODE]time = …

Member Avatar for somename
0
361
Member Avatar for Aia

I am aware that RMDIR /S /Q will delete any directory in a quiet way even if it has content. However, it does not allow the use of wild char for the removal in batch mode. How can I accomplish the task of deleting several directories at once at the …

Member Avatar for Aia
0
137
Member Avatar for rob_xx17

[iCODE]fprintf(pFile,"%d ",State[STATE_SONAR_0+i]/255);[/iCODE] That would be the syntactically correct way of do it. However if the result of the division is a decimal number an int ("%d") will loose precision. Moreover you are not checking the return of fprintf to ensure that it did the job. A negative number would indicate …

Member Avatar for jephthah
0
97

The End.