1,088 Posted Topics

Member Avatar for platinum8

>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! ;)

Member Avatar for R0bb0b
0
217
Member Avatar for En-Motion

>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 …

Member Avatar for WaltP
0
340
Member Avatar for itdupuis

[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 …

Member Avatar for itdupuis
0
486
Member Avatar for hikaru1239

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 …

Member Avatar for Aia
0
83
Member Avatar for rob_xx17

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.

Member Avatar for ArkM
0
318
Member Avatar for Madd0g17

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 …

Member Avatar for Madd0g17
0
95
Member Avatar for vmanes
Member Avatar for ahamed101
3
94
Member Avatar for staufa

>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 …

Member Avatar for HiHe
0
190
Member Avatar for mybluehair2
Member Avatar for marco93
0
119
Member Avatar for Dave Sinkula

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]

Member Avatar for GrimJack
0
123
Member Avatar for kyeong

>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, …

Member Avatar for Aia
0
160
Member Avatar for sneekula

[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.

Member Avatar for Aia
0
129
Member Avatar for MyRedz

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].

Member Avatar for Aia
0
106
Member Avatar for tytelizgal

Maybe post the portion of the code that gives you the error? The structure definition is correct.

Member Avatar for ahamed101
0
94
Member Avatar for Aia

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.

Member Avatar for Aia
0
141
Member Avatar for dusse

[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 …

Member Avatar for Aia
0
345
Member Avatar for vmars
Member Avatar for sneekula
0
114
Member Avatar for joelogs

[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 …

Member Avatar for Freaky_Chris
0
185
Member Avatar for The Dude

I disagree with Obama 99.1% and I didn't even take the poll.

Member Avatar for steven woodman
0
171
Member Avatar for rrreeefff

I don't see any increments of three anywhere. Shouldn't sum be initialized to zero?

Member Avatar for Amisha_Sharma
0
135
Member Avatar for shadwickman
Member Avatar for shadwickman
0
141
Member Avatar for srivtsan

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. ;)

Member Avatar for Aia
0
97
Member Avatar for Lardmeister

[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.

Member Avatar for sneekula
0
366
Member Avatar for anny**

>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 …

Member Avatar for Narue
0
153
Member Avatar for maker10

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 …

Member Avatar for Sci@phy
0
76
Member Avatar for rugs267

[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.

Member Avatar for rugs267
0
110
Member Avatar for dhingra

[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 …

Member Avatar for ahamed101
0
111
Member Avatar for tondet2

[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 …

Member Avatar for ahamed101
0
90
Member Avatar for ahamed101

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 …

Member Avatar for ahamed101
0
1K
Member Avatar for rrreeefff

>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.

Member Avatar for devnar
0
498
Member Avatar for bumsfeld

[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.

Member Avatar for GrimJack
3
200
Member Avatar for patricksquare

>can you help? Yes. This is what you [URL="http://www.catb.org/~esr/faqs/smart-questions.html#code"]need[/URL].

Member Avatar for WaltP
0
112
Member Avatar for chrissygirl

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.

Member Avatar for tessen
0
254
Member Avatar for GrimJack

[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]

Member Avatar for sneekula
0
254
Member Avatar for rrreeefff

[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 …

Member Avatar for Aia
0
77
Member Avatar for rob_xx17

[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 …

Member Avatar for rob_xx17
0
108
Member Avatar for DogfoodEnforcer

[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.

Member Avatar for Aia
0
104
Member Avatar for san_sarangkar

[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.

Member Avatar for Aia
0
151
Member Avatar for DogfoodEnforcer
Member Avatar for anuj_sharma

[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.

Member Avatar for Narue
0
99
Member Avatar for Se7Olutionyg

[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 …

Member Avatar for Aia
0
157
Member Avatar for intsoda

[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.

Member Avatar for intsoda
0
111
Member Avatar for plike922

[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 …

Member Avatar for Aia
0
98
Member Avatar for RayvenHawk

Perhaps consider a menu using a [URL="http://www.cprogramming.com/tutorial/lesson5.html"]switch[/URL] case construction?

Member Avatar for RayvenHawk
0
205
Member Avatar for KDizzle

> 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 …

Member Avatar for josh2
0
147
Member Avatar for TheNational22

[URL="http://www.faqs.org/docs/diveintopython/kgp_commandline.html"]Handling command line arguments [/URL] Maybe that would help?

Member Avatar for sneekula
0
157
Member Avatar for Clockowl

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 …

Member Avatar for WaltP
0
450
Member Avatar for OUKNO

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 …

Member Avatar for Aia
0
157
Member Avatar for blackcorner

[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.

Member Avatar for ZZucker
0
213
Member Avatar for christina>you

>We know things that we shouldn't even need to know. I hear that ignorance is bliss. However I never hear that before.

Member Avatar for GrimJack
0
2K

The End.