5,676 Posted Topics

Member Avatar for The Dude

The average temp over the past 100 years has increased a whopping 1 degree F. Scary!!! :S So if this uncontrolled rise in temp is not checked, we'll be in danger in about 3564AD. '[I]Global warming[/I]' is a naturally occurring phenomenon that is cyclical.

Member Avatar for Dave Sinkula
0
973
Member Avatar for BITMAN2124

[QUOTE=BestJewSinceJC;733868]From when I programmed in C, I remember that output stream redirection is done by a.out > filename.txt or a.out < filename.txt I don't remember which. One is input redirection, the other is output. I think the first is output.[/QUOTE] 1) Yes, the first one is output 2) How does …

Member Avatar for BITMAN2124
0
310
Member Avatar for Briterican

Please read [url=http://www.gidnetwork.com/b-58.html]this[/url] about using [ICODE].eof()[/ICODE] the way you are (it's the same as using [ICODE]feof()[/ICODE]. And read [url=http://www.gidnetwork.com/b-38.html]this[/url] about formatting your code so it can be understood.

Member Avatar for WaltP
0
113
Member Avatar for gayatri.saha

[QUOTE=Ancient Dragon;728164]The code you posted will have undefined behavior. [icode]cube(++x)[/icode] could result in different answers on different compilers, so the ourput can not be determined exactly.[/QUOTE] Why? It increments [B]i[/B], calls [ICODE]cube[/ICODE] with the new value, then returns the answer to [B]y[/B]. What's undefined about it? [B]i[/B] isn't modified twice.

Member Avatar for WaltP
1
109
Member Avatar for frank*
Member Avatar for Sauron911

No wonder those links don't help. They have nothing to do with the problem. First off, [I]res[/I] is already binary. If you know the shift operator ([B]<<[/B]), that makes it easy to count the 0's. Look it up and see what you come up with.

Member Avatar for WaltP
0
90
Member Avatar for afromong

Every solution proposed here has major problems -- that of trying to read an integer when a 'not a number' can be entered which screws up the entire read process.. You need to read [I]an entire line[/I] as a string, test all characters entered up to the '\n' to make …

Member Avatar for afromong
0
86
Member Avatar for ajay.krish123

[QUOTE=keyser_soze;726512]i think u might use the getch() putch combination use getch to enter the charcter one by one and then using putch print out * example: [code=c] getch(password[x]); //where x runs in a loop from 0 till NULL putch('*'); [/code] PS:go through this thread [code][url]http://www.daniweb.com/forums/thread9916.html[/url][/code] has a better detailed solution....[/QUOTE] …

Member Avatar for ajay.krish123
0
108
Member Avatar for amvx86

When you find you have a parameter that starts [B]-t:[/B], use [ICODE]strcpy()[/ICODE]: [code=c]strcpy(websitename, &argv[p][3]);[/code] [B]p[/B] is of course the parameter number [B]3[/B] points to the character after the colon

Member Avatar for WaltP
0
104
Member Avatar for henks

[code] strcpy(input," "); // You don't need to do this if your next // line overwrites the value scanf("%s",&input); // [url=http://www.gidnetwork.com/b-62.html]see this[/url] fflush(stdin); // [url=http://www.gidnetwork.com/b-57.html]see this[/url] [/code]

Member Avatar for henks
0
145
Member Avatar for ohnomis

You need to change your increment: [code=c] case 5: //move forward x number of spaces int steps = commands[ ++cmd ]; [/code] This will increment [I]before[/I] you load [I]steps[/I], getting the number of steps.

Member Avatar for vidit_X
0
152
Member Avatar for atman
Member Avatar for Aia
0
237
Member Avatar for Dontais

To all of you, floating point values are rarely exact. Therefore testing with == will rarely work. For example, if you entered 46, the actual value stored in the variable might be 46.000001 or 45.9999997, neither of which is equal to 46.

Member Avatar for seanhunt
0
164
Member Avatar for SQ89

[QUOTE=SQ89;723738]Thank YOU :) but can you explain to me how col works?? i mean in the if statement[/QUOTE] Every time you output a number, you increment [I]col[/I]. When [I]col[/I] is 3, 3 number have been displayed (3 cols) so you drop to the next line and reset [I]col[/I] to count …

Member Avatar for ddanbe
0
155
Member Avatar for cproud21

So much help, so little correct :icon_rolleyes: To find the lowest value, store the first value read in a variable, say [I]lowest[/I]. Then for each successive read, test the value read against [I]lowest[/I] and replace if necessary.

Member Avatar for sidatra79
0
82
Member Avatar for kalou

[QUOTE=kalou;723393] i need a help so badly.[/QUOTE] Then you should have read [I]The Rules[/I] and the post [I]Read This Before Posting[/I]

Member Avatar for William Hemsworth
0
87
Member Avatar for Code Shark

I agree with [B]thwee[/B] -- the [ICODE]for(;;)[/ICODE] is nonsensical. If you are trying to keep your program window open, just do the [ICODE]get()[/ICODE]

Member Avatar for gregorynoob
0
115
Member Avatar for unleashedvigil

Did you call [ICODE]srand()[/ICODE] only once? Or every time you called [ICODE]rand()[/ICODE]?

Member Avatar for unleashedvigil
0
86
Member Avatar for sudokusolver

Also speak English, not pigeon-speak. And use CODE tags. They are described everywhere on this site.

Member Avatar for WaltP
0
118
Member Avatar for randika2000e

[QUOTE=randika2000e;721714]hay dear i need help for c prog... i used <textcolor (14+128) ,cprint> commands to blink some text. befor i drow rectanngel and some circle as back image. but the text is not apper. if i closed the graphic mood, then it'll show. but i need kept the graphic back …

Member Avatar for WaltP
-1
154
Member Avatar for nimasafa
Re: Help

[QUOTE=nimasafa;720264]would please correct it for me and posted in this forum, It's been 4 hours I've working on this but it doesn't work.[/QUOTE] All you have to do is [B]count!![/B] [code]#include <iostream> #include <cmath> using namespace std; void Instructions(); float do_next_op(char op, float o, float CAV); void startCalculatorProgram(); void main() …

Member Avatar for WaltP
0
135
Member Avatar for En-Motion

You might be able to use the built-in functions [ICODE]ispunct()[/ICODE] and [ICODE]isspace()[/ICODE] to 'tone down' some of the long windedness.

Member Avatar for WaltP
0
340
Member Avatar for Ninad16

[QUOTE=Sci@phy;715626] They differ a lot, since turbo c++ compiler is ANCIENT. There is something that is called standard C++ language. It wasn't fully defined at turbo c++ time, so some things that were differently defined don't work nowadays.[/quote] But, for a new student, these differences [I]can be[/I] minor. I rarely …

Member Avatar for Narue
0
394
Member Avatar for En-Motion

[QUOTE=Ancient Dragon;712707]after entering an integer the program leaves the '\n' in the keyboard buffer. When the next getchar() is called it gets that '\n' from the buffer instead of waiting for user input. To correct this add getchar() after scanf("%d", &consump);[/QUOTE] [QUOTE=cutedipti;714529] See the problem is due to the 'New …

Member Avatar for WaltP
0
148
Member Avatar for NinjaLink

Where did you use the variable [icode]index[/icode] to insert the variable [icode]insertItem[/icode] into the array?

Member Avatar for NinjaLink
0
414
Member Avatar for mauro21pl

[QUOTE=ahamed101;713331]As per you, it is C, then this is the right forum... And what makes you say, its c++??...[/QUOTE] The actual questions deal with the calculations, not the output statements. They are fully C++ as well as C. And [ICODE]printf()[/ICODE] is a C++ function. Check any C++ book/tutorial/standard.

Member Avatar for WaltP
0
122
Member Avatar for maker10

[QUOTE=ahamed101;710301]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][/QUOTE] …

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

[QUOTE=Sci@phy;706668] [CODE=C] char decision; int flag = TRUE; while (flag){ /*do some stuff here*/ printf ("Do you want to continue (y/n)\n"); scanf("%c", &decision); /*be careful, \n stays in input buffer*/ if (decision == 'y') flag = TRUE; else flag = FALSE; }[/CODE][/QUOTE] What a gross input statement. [url=http://www.gidnetwork.com/b-60.html]See this[/url].

Member Avatar for stilllearning
0
74
Member Avatar for patricksquare

And posts should NEVER be marked urgent! It's not urgent to us -- we'll get to it when we get to it. And many people simply bypass threads titled like this so you've just cut down your chances for help.

Member Avatar for WaltP
0
112
Member Avatar for DanDaMan

[B]stilllearning[/B] is correct. The compiler is only interested in the statements that do something so comments are not part of the compiled program.

Member Avatar for Denniz
0
366
Member Avatar for EBaller55

[QUOTE=EBaller55;704374]It would be nice because then I could do the following: [code] for(int i=0, double d=1;i<5;i++,d*=1.5){cout<<"1.5^"<<i<<"="<<d<<endl;} [/code] This would make for cleaner code as it is clear that i and d are used only inside the for loop.[/QUOTE] I disagree. That to me is confusing and unclean. On the other …

Member Avatar for ArkM
0
253
Member Avatar for Clockowl

[QUOTE=Clockowl;702885]On the second page of the thread is a small testing program and some results showing that I only had the problem using fread() on "text" opened files, not on binary opened ones. [/QUOTE] You obviously missed [B]Narue[/B]'s answer to this problem: [QUOTE=Narue;702682][code] size_t n = fread ( buf, 1, …

Member Avatar for WaltP
0
450
Member Avatar for dspnhn

[QUOTE=dspnhn;686435]Good evening..... I just wanted to share an idea.....can this forum be downsized into categories such as API,FORMS,CONTROLS,DATA REPORTS and so on.....the reason i am saying this is people are lost in here....[/QUOTE] Who besides you is lost? Have you tried Hare Krishna...:icon_twisted: (see The Muppet Movie)

Member Avatar for Dani
0
127
Member Avatar for flipjoebanana

If the file was included just open the file. If the file was not included, open [I]stdin[/I] instead. [code=c] if (filename_entered) open file else open stdin end if [/code]

Member Avatar for flipjoebanana
0
161
Member Avatar for grisha83

[QUOTE=grisha83;694490]Anyhow, here is my code and the errors are C2676 and C2784 in Visual Studio[/QUOTE] Since we are humans, not compilers, C2676 and C2784 mean nothing. And even less because we don't know what lines caused the error. Details, me bucko, details. They are important.

Member Avatar for Sci@phy
0
104
Member Avatar for cutedipti

[QUOTE=lonerider30;694546]To get ths output u will have 2 flush the input buffer after every char input Enter Gender Male/Female(M/F): M Enter Residence City/village(C/V): (it'll not wait here to take i/p & jumps on next line) Enter Health Excellent/poor(E/P): E Enter Age: 25 printf("Enter Gender Male/Female:"); scanf("%c",&gender); //gender is char type …

Member Avatar for cutedipti
0
111
Member Avatar for policeachan

[QUOTE=policeachan;691148]it is known that dennis rithie made c with only 32 keywords and writing functions is the responsibility of the programmer. who wrote the functions printf, scanf?[/QUOTE] Usually the author of the compiler that has the functions defined.

Member Avatar for Narue
0
170
Member Avatar for devnar

Each function and arrow key is really two characters, a \0 followed by another character. Note the code: [code=c] KeyStroke = getch(); if (KeyStroke == 0) { KeyStroke = getch(); switch (KeyStroke) [/code] Get a keystroke with the first [icode]]getch()[/icode] call If that value is a 0, get the [I]next[/I] …

Member Avatar for devnar
0
197
Member Avatar for BattlingMaxo

[QUOTE=Ancient Dragon;690578]PM your address and I'll mail you a copy of the dvd (yes its a legal copy, I download the ISO fle and made my own dvd).[/QUOTE] Wouldn't it be faster even with dialup to download and burn the ISO instead of waiting for the US Snail?

Member Avatar for BattlingMaxo
0
121
Member Avatar for Trekker182

[QUOTE=Trekker182;690711]I have to take a 2d array of [6][8] floats that represent a star map and add the four surrounding numbers to it to measure it's intensity of light. Would something like make sense??? [CODE]for(i=0;i<6;i++) { for(j=0;j<8;j++) { stars[i][j+1] + stars[i+1][j] + stars[i-1][j] + stars[i][j-1];}}[/CODE] instead of writing many lines …

Member Avatar for Trekker182
0
179
Member Avatar for olsoul_41
Member Avatar for Salem
Member Avatar for Niklas
Member Avatar for tracethepath

Nothing else is output to the screen. What do you expect to happen? If you think there's a problem, add a few [ICODE]cout[/ICODE] statements to follow what's happening and pinpoint the problem. And isn't this a C++ program? Why are you using the extremely dangerous C function [url=http://www.gidnetwork.com/b-56.html]gets()[/url] when there …

Member Avatar for udayasankar
0
9K
Member Avatar for riahc3

Look into the [I]time[/I] functions in [I]timer.h[/I] for ways to do the counters. If you need help in other areas, please be specific.

Member Avatar for jephthah
0
138
Member Avatar for Salem

Maybe for a member's first 5 posts a message displays with the high points of posting and what may happen if ignored.

Member Avatar for jasimp
1
192
Member Avatar for William Hemsworth
Member Avatar for Ancient Dragon
0
98
Member Avatar for acejames1

[QUOTE=sittas87;672096]and I regard all of that with great respect.but honestly thats life and it wont change.let me put it this way you're on youre way to buy a expensive sofware[witch they always are] and your geeky friend comes over and offer you a cracked version with no prob's to experience, …

Member Avatar for Alex Edwards
0
215
Member Avatar for kneiel
Member Avatar for mimo77

So we're supposed to write your program because you're in chemical engg? Explain this...

Member Avatar for papuccino1
-1
197

The End.