1,088 Posted Topics
Re: >Ok, I know I am gonna hear it from several of you You shouldn't. Unless any of them helped you to pay for it. >...I choose the flatness!! I choose you, Pikachu! ;) | |
Re: >It runs now but when i type in a sentence i need to type 2 EOF commands and now it counts words and gives 0 for characters. Logic flaw you introduced had. [CODE]while (found_word() == 1) ++nw; [/CODE] Here you read everyone of what you loosely call word, going through … | |
Re: [QUOTE=Ezzaral;702016]You bet. All those "crazy scientists" just want to kill themselves and their families. Thanks for highlighting your ignorance in bold red letters for all to see.[/QUOTE] Impetuous you are. Speculation is part of the unknown. I am sure you are much ignorant on this matter as well. When scientists … | |
Re: The standard input (stdin) is buffered. That's why you can write and nothing happens until you give the signal to go ahead and read. That occurs when you press ENTER/RETURN. fgets() can only read up to n-1 of whatever size of buffer you have set apart for it. In this … | |
Re: If you use fgets() to read a line containing floating points you need to parse that line afterwards. sscanf() can do that for you. fscanf() can format floating points values directly as an alternative. Take a look at those. | |
Re: Take it one step at a time. Start figuring how to generate the random number from one to ten. After that lean how to open a file for reading. Follow with reading a line from file and storing it in a buffer. Once you got that down, you can start … | |
Re: The self destruction bottom convinced me. The rest is just icing in the cake. | |
Re: >I'm getting an unexpected error for my piece of code. It seems like a new line character is added into the string once is it called. fgets() will read and add the ENTER key as a newline if there's space in the buffer given. People are fond of using this … | |
Re: Would that help? [url]http://www.winprog.org/tutorial/start.html[/url] | |
Re: Results: [QUOTE]Your answers suggest that you are a Libertarian. The yellow star shows more precisely where you fall within the Libertarian region of the Nolan chart.[/QUOTE] | |
![]() | Re: >When I input zero for X, it moves on and ask for Y. Now, it's not suppose to do that. It's suppose to output an error message and asking me for a different input. The get_input () has a logic flaw then. It asks for X and then for Y, … |
Re: [QUOTE=Ancient Dragon;715201]40% Republican and 36% Democrat. So I guess that means I'm 24% Libertarian.[/QUOTE] 24% undefined. Especially, when there are more parties than three. | |
Re: It appears to me you can benefit from reading a little bit more about some basic concepts of C language. Click [URL="http://www.cprogramming.com/tutorial/c/lesson2.html"]here[/URL]. | |
Re: Maybe post the portion of the code that gives you the error? The structure definition is correct. | |
Hurray, finally, reason to celebrate!!! ...Wait, not so fast, there could be adverse side effects. Watch [URL="http://www.youtube.com/watch?v=R7mRSI8yWwg&eurl=http://neverfindout.org/"]this[/URL] and see if you can tell what's the catch. | |
Re: [ICODE]char *d[] = {"aaaa","bbbb","cccc"};[/ICODE] These strings reside in read only memory. They can not be altered. You can not re-assign to them, without raising an error. [CODE][COLOR="Red"]d[2][2] = 'x';[/COLOR][/CODE] [COLOR="Red"]Wrong![/COLOR] >How can I change a character of a string within an array of strings? [ICODE]char *d[][/ICODE] is an array of … | |
Re: >What does the ' \n' mean? New line, or sometimes RETURN keyboard. | |
Re: [QUOTE=joelogs;712804]what does in ncurses does? is it sort of a gui library/package/API? i'm more into java so i'm thinking that it is similar to java's AWT and SWING library. am i right? thanks for the response btw. :)[/QUOTE] Read the introduction in the link Salem posted for you. If it … | |
Re: I don't see any increments of three anywhere. Shouldn't sum be initialized to zero? | |
Re: [url]http://mail.python.org/pipermail/python-list/2005-March/311942.html[/url] | |
Re: But I don't want the last set to end with a (,). Could you give me code without the last printed (,)? Pleazzzzzzzzzzz! Well, srivtsan, finally your hard work of asking [URL="http://answers.yahoo.com/question/index?qid=20081011075322AADRaXW"]here[/URL], [URL="http://www.mathhelpforum.com/math-help/pre-algebra-algebra/53099-series-help.html"]here[/URL], [URL="http://cboard.cprogramming.com/showthread.php?t=108003"]here[/URL] and over here has payed off. ;) | |
Re: [QUOTE=R0bb0b;695642] And here's the kicker, even though I am so rich, I still live a very simple lifestyle. :cool: :cool: :cool:[/QUOTE] Now that's the secret to not get taxed on it. Remember, rich people are despised in this country. | |
Re: >You need to flush the input buffer before you get the next input... What if there's nothing to flush from the buffer before input? >[ICODE]while((ch = getc(stdin)) != EOF && ch != '\n');[/ICODE] What's more likely to occur first, the END OF FILE or the ENTER key? >[ICODE]scanf("%c", &operation);[/ICODE] I … | |
Re: Inside the for loop substitute the if for a do/while. [CODE=C]... do { printf("Enter salary #%i: ",i); fflush(stdout); if (!(scanf("%d", &i) == 1)) { fprintf(stderr, "Error, you didn't enter a valid input"); break; } }while( i < 0); ... [/CODE] Thank you for taking the time of reading and using … | |
Re: [QUOTE=Freaky_Chris;709455]If you are looking to convert strings and into integers, you may want to check out the atoi() function. Chris[/QUOTE] Not my first or second choice. atoi() falls short at error handling. strtol() is a better alternative. | |
Re: [QUOTE=dhingra;709644][code=c] while(i*j<0&&++i!=7&&j++!=9) [/code][/QUOTE] That loop it is an absurdity. In the best case if the product of i * j is a negative number the pre-increment of i would always be something other than seven and the post-increment of j something other than nine. At the other hand. If the … | |
Re: [QUOTE=tondet2;708057] the problem iam now facing is that i now want the standing charge and the rate per unit to be variable not fixed, in other words i want the program after running it to prompt me to enter the standing charge and the rate per unit.[/QUOTE] Create two floating … | |
Re: if the function returns an int what do you think the variable that stores that value should be in main? Either terminate the literal string in printf with a \n or make a call to fflush(stdout) after. Otherwise there's not guarantee that it will display when you want. A call … | |
Re: >cpp(23) : error C3861: 'mypower': identifier not found Do you know what that cpp means? You are compiling the code as a C++ program. C code must end as *.c Anyway. The error says that you are not prototyping the function mypower correctly. | |
Re: [I]"I don't know half of you half as well as I should like, and I like less than half of you half as well as you deserve." [/I] As irrelevant to this thread as counting posts and green dots is irrelevant to this site. | |
Re: >can you help? Yes. This is what you [URL="http://www.catb.org/~esr/faqs/smart-questions.html#code"]need[/URL]. | |
Re: If I am making heads or tails of what you're saying what you want it is called permutation. There's lots of algorithms out there for it. Use you favorite search engine. | |
Re: [URL="http://minx.cc/?post=274771"]Joe Biden's View, from the Floor[/URL] As the author proposes: [I]"Getting knocked out has its advantages."[/I] | |
Re: [ICODE]scanf ("%[COLOR="Red"]d[/COLOR]", &a);[/ICODE] What type is variable a? [code=syntax] substitute syntax for C in this forum. [[COLOR="Red"]/[/COLOR]code] add the (/) to the closing bracket. #include "stdio.h" will make the compiler to look for the file stdio.h in the current directory first and then in the path that the compiler have … | |
Re: [QUOTE=stilllearning;704540]You probably want to put a break after each case statement in your switch ? otherwise it will just go onto the next one [icode] switch (number){ case 1: break; case 2: break; ...... } [/icode][/QUOTE] You need to look a little bit closer. There are breaks where they are … | |
Re: [CODE]/* begin */ printf("Please enter a binary string of 1's and 0's: "); scanf("%c",&binary); [/CODE] Are you teasing the user? You ask for a string, and then only care about the first char. | |
Re: [QUOTE=san_sarangkar;704470]But there is for loop in it but program should not contain any loop.[/QUOTE] Let me tell you a secret, every thing deep inside of the machine, are loops and go to. Use a search engine, that question is all over, even when I don't understand the profit of it. | |
Re: [URL="http://www.daniweb.com/code/snippet141.html"]Example[/URL] | |
Re: [QUOTE=Narue;704355][...] Quite frankly, Java seems better suited to your personality. [...] you're better off with a language designed for idio^H^H^H^H...um...for l33t h4k3rs with m4d sk1llz[1]. [/QUOTE] Darn, girl! Didn't know you felt so strongly about Java. | |
Re: [QUOTE=Se7Olutionyg;703893] I don't know why the program does not run base on the order I set up it draw the base before the intersect..[/QUOTE] Nope, it does exactly what you program to do. Delete all the cin.get() inside the functions, and call them if you want after it draws each … | |
Re: [URL="http://msdn.microsoft.com/en-us/library/aa363480(VS.85).aspx"]WM_DEVICECHANGE Message[/URL]? [URL="http://support.microsoft.com/kb/163503"]More[/URL] explanation about it. | |
Re: [QUOTE=stilllearning;703794]Does your code compile ? One thing I notice is that [icode] bool space=true;[/icode] .. bool is a C++ data type.[/QUOTE] Naw, she/he has been told several times already, and apparently can't figure out there's a different between C and C++. That C ends in *.c and C++ ends in … | |
Re: Perhaps consider a menu using a [URL="http://www.cprogramming.com/tutorial/lesson5.html"]switch[/URL] case construction? | |
Re: > better? Not quite. Make use of the C in the (code=c). [Example](http://www.daniweb.com/forums/thread93280.html) Of course, that would not be worth a pinch of dirt if you did not care about proper [indention ](http://www.gidnetwork.com/b-38.html) before hand. After that take a look at [void main()](http://www.gidnetwork.com/b-66.html) Also, unless you have copied the standard … | |
Re: [URL="http://www.faqs.org/docs/diveintopython/kgp_commandline.html"]Handling command line arguments [/URL] Maybe that would help? | |
Re: Remembering about that other thread, I thought you finally understood that if you are going to use fread() you need to open the file in binary mode. [CODE]FILE *pFile = fopen(loc, "r[COLOR="Red"]b[/COLOR]");[/CODE] Furthermore, perhaps due to your familiarity with C++ you are using that language syntax for C and it … | |
Re: If windows 2000 is in a different partition than windows xp pro, log into xp and go to that partition which will show in another letter. Right click it and format. Then you have to modify the C:\boot.ini file where the entries for choosing boot are. That's a hidden file … | |
Re: [QUOTE=sneekula;702714]If you don't mind learning regex, which is almost another language[/QUOTE] Regex it is just that, [URL="http://www.regular-expressions.info/tutorial.html"]regular expression[/URL]. A pattern describing some text. | |
Re: >We know things that we shouldn't even need to know. I hear that ignorance is bliss. However I never hear that before. |
The End.