5,676 Posted Topics

Member Avatar for Azurea

Compilers [url=http://www.codeblocks.org/downloads.shtml]Code::Blocks[/url] [url=http://msdn.microsoft.com/vstudio/express/visualc/]MSVC++ Express[/url] [url=http://www.openwatcom.org/ftp/]Open Watcom C++/Fortran[/url] [url=http://www.bloodshed.net]Bloodshed DevC[/url] [url=http://www.borland.com/downloads/download_cbuilder.html]Borland 5.5[/url] [url=http://bdn.borland.com/article/21751]Turbo 1.01[/url] [url=http://bdn.borland.com/article/20841]Turbo 2.01[/url] [url=http://148.231.149.200/aplic/tc30.zip]Turbo 3.0[/url]

Member Avatar for ithelp
0
119
Member Avatar for asilter

You can't possibly get 155.419 from an [I]unsigned long[/I], there is no decimal point from integers. You need [I]float[/I] or [I]double[/I]. And dividing two integers always gives an integer, even if you load it into a floating point number. For example: [code=c] double dval; dval = 25/2; [/code] 12.000 is …

Member Avatar for asilter
0
3K
Member Avatar for Flakester

First of all, how about variables named [I]day[/I], [I]month[/I], and [I]year[/I] instead of 1 letter cryptic names. And what is [I]z[/I] for? Are you sure your date validation works? Look up the % operator to get the individual digits of each value so you can add them up. There are …

Member Avatar for WaltP
0
122
Member Avatar for cyndi.

Read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url], especially [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]this one[/url]. Also read the sticky at the top of the forum titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][B]Read Me: [/B]Read This Before Posting[/url]

Member Avatar for WaltP
0
128
Member Avatar for nicz888

[code] Make a loop that exits when your value is zero In the loop, calculate the modulo-10 of the value using % (get the ones digit) output the digit divide the number by 10 endloop [/code] That's basically it.

Member Avatar for WaltP
0
315
Member Avatar for Ratte

EXTERN simply defines the variable to be accessible from a another source file. Add the EXTERN statement in a local header file and define the variable in only one of the source files. For example, in the [I]error.c[/I] source file you might define [inlinecode]int errCode = 0;[/inlinecode] In [I]error.h[/I] you …

Member Avatar for WaltP
0
100
Member Avatar for gerronk

Seems to me you can't actually [I]solve[/I] the equation without some values. Therefore, ask your instructor for more details.

Member Avatar for Lerner
0
159
Member Avatar for helixkod

[QUOTE=helixkod;461729]After testing the code i did come with the final result i wanted thanks to Duoas. Now my question is, how do i set it so i make an array that i do not know how big it will be since the user will input the info. in other words …

Member Avatar for vijayan121
0
197
Member Avatar for chizy2

Rule of thumb -- if you need [I]both[/I], use && (and). If you need [I]either[/I], use || (or). Test it by using English (or your native language): is it "[I]if != Q or q[/I]" or is it "[I]if != Q and q[/I]" and you get the operator to use.

Member Avatar for chizy2
0
143
Member Avatar for Etniespr101

I can't see how this code does anything. You have 3 nested [INLINECODE]while[/INLINECODE] loops all exiting on the same condition. And if you [url=http://www.gidnetwork.com/b-58.html]read this[/url] you'll see your condition is wrong ([INLINECODE]feof()[/INLINECODE] is the same as [INLINECODE].eof()[/INLINECODE]) Then in the second loop, you read a single character and output it. …

Member Avatar for zandiago
0
111
Member Avatar for dasani

Count each number you output. After every 6th number, output a newline (\n) Use the % operator.

Member Avatar for dasani
0
100
Member Avatar for garc2541

Not a clue what you are asking, and your code is too hard to read. Try formatting the code using [url=http://www.gidnetwork.com/b-38.html]this info[/url] so we can follow what you're trying to do.

Member Avatar for vmanes
0
102
Member Avatar for mqueene7

The idea of this forum is to post the code here (properly please) and we [I]all[/I] get a chance to help you. Be sure to [url=http://www.daniweb.com/techtalkforums/thread78223.html]read this first[/url]

Member Avatar for WaltP
0
84
Member Avatar for turkgames

Start by reading [url=http://www.daniweb.com/techtalkforums/thread78223.html]this[/url] and [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]this[/url].

Member Avatar for WaltP
0
101
Member Avatar for catdieselpow

Please [url=http://www.gidnetwork.com/b-38.html]format[/url] your code. It's really hard to follow.

Member Avatar for WaltP
0
209
Member Avatar for bujoldea

DaysFirst = How many days left in the first month DaysLast = essentially the day of the last month - 1 DaysMonth = number of days in each month between the two months Add them all together. Example: 4-May-2007 to 23-Sep-2007 DaysFirst = 27 (31 days in May - 4) …

Member Avatar for bujoldea
0
93
Member Avatar for zandiago

Personally, I'd read the test answers into a [INLINECODE]char*[/INLINECODE] rather than a C++ [INLINECODE]string[/INLINECODE]. A [INLINECODE]char*[/INLINECODE] must be defined to accommodate the total number of answers necessary, but a [INLINECODE]string[/INLINECODE] will read only the answers on the line. If a student doesn't answer the last 5 questions, the [INLINECODE]string[/INLINECODE] could …

Member Avatar for zandiago
0
3K
Member Avatar for donaldunca

Use a loop to generate as many random numbers from 0 to 25 as you want and add the values to the string. When you get the random number, simply add 'a' to it and you will have all letters instead of 0-25

Member Avatar for donaldunca
0
163
Member Avatar for crunchycrisp

You need to read each line. The \n\n will take two lines. You can tell the second \n because the line will be extremely short. == may not be good, but < might work better. Depends on how consistent the blank lines are -- extra SPACEs for example.

Member Avatar for Aia
1
154
Member Avatar for appuguy

[QUOTE=appuguy;459179] -------------------Configuration: Test - Win32 Debug-------------------- Compiling... myfiletesting.c C:\Documents and Settings\HP_Administrator\myfiletesting.c(16) : warning C4029: declared formal parameter list different from definition C:\Documents and Settings\HP_Administrator\myfiletesting.c(28) : warning C4028: formal parameter 1 different from declaration[/quote] Look at the lines specified. You are calling a function, but the parameters do not match the …

Member Avatar for WaltP
0
255
Member Avatar for anirudhbsg
Member Avatar for people123

[QUOTE=people123;459073]how should i improve my formatting, can you please give me an example... i just get lost of what has to be where when im writing[/QUOTE] Here's a turotial on [url=http://www.gidnetwork.com/b-38.html]Formatting C / C++ code[/url]

Member Avatar for WaltP
0
147
Member Avatar for DemonSpeeding

First things first -- put braces around everything that needs them -- around statements contained in [INLINECODE]if[/INLINECODE]s, [INLINECODE]else[/INLINECODE]s, [INLINECODE]switch[/INLINECODE]es, [INLINECODE]for[/INLINECODE]s, etc. And indent them properly. [I]Then [/I]we can see what's going on.

Member Avatar for Duoas
0
148
Member Avatar for dabu
Member Avatar for MidiMagic

I just did a quick check and found the following :icon_twisted: (this is mostly just in fun, don't get your knickers in a knot) [code] Some of my old problems are back Sep 29th 2007 3:38 pm Cursor is disappearing Sep 6th 2007 6:27 pm Scroll arrows won't repeat. Sep …

Member Avatar for MidiMagic
0
128
Member Avatar for Ccrobinson001

Neither can we. You need to [url=http://www.gidnetwork.com/b-38.html]format[/url] your code, and use [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]CODE[/url] tags.

Member Avatar for WaltP
0
270
Member Avatar for jigart4586
Member Avatar for Ancient Dragon
0
110
Member Avatar for tom1989
Member Avatar for tracethepath

[QUOTE=iamthwee;458275]>gets(name); [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351[/url][/quote] Yes, [INLINECODE]gets()[/INLINECODE] is a very dangerous function, as is [INLINECODE]scanf("%s",...)[/INLINECODE] in exactly the same way. [QUOTE=iamthwee;458275]>clrscr(); Non portable[/quote] As is [INLINECODE]getch()[/INLINECODE]. Best to remove [I]conio.h[/I] completely and use no functions from it because most compilers won't be able to compile your programs. [QUOTE=iamthwee;458275]>while (!fil.eof()) Doesn't work as you …

Member Avatar for WaltP
0
2K
Member Avatar for tom1989

Look up the definition of a [INLINECODE]for [/INLINECODE]loop. What do each of the parts of the loop do? Do your parts comply?

Member Avatar for WaltP
0
115
Member Avatar for people123

[QUOTE=people123;458251]Thanks a lot, may I ask what was the [inlinecode]std:string line;[/inlinecode] ...[/quote] Define the variable [I]line[/I] as a [B]string[/B] variable [QUOTE=people123;458251]... and the [inlinecode]getline(cin,line)[/inlinecode] for?[/QUOTE] [I]get[/I] a [I]line[/I] ([INLINECODE]getline()[/INLINECODE]) entered from the keyboard up to the \n and put it in the variable [I]line.[/I]

Member Avatar for tracethepath
0
118
Member Avatar for mypopope

[QUOTE=tracethepath;458655]sorry i have not read strings yet so didnt know... can you tell me more about that?? thanx...[/QUOTE] Then wait until you read about strings. Until then use [INLINECODE]strcmp()[/INLINECODE] or [INLINECODE]strncmp()[/INLINECODE] which works for your definitions.

Member Avatar for WaltP
0
239
Member Avatar for blindkilla

Try using a [INLINECODE]while [/INLINECODE]look for the first loop instead. A [INLINECODE]for [/INLINECODE]loop implies you know how many times you need to go through the loop. A [INLINECODE]while [/INLINECODE]implies you exit the loop when some criteria is satisfied, such as you reached the end-of-file ([INLINECODE]EOF[/INLINECODE]). Since you seem to know …

Member Avatar for WaltP
0
118
Member Avatar for mister-fett

[QUOTE=ithelp;458246]That is quite messy. Better move to perl/php[/QUOTE] Yes, it's quite messy because you used TABs for indentation instead of 3-4 SPACEs. Outside of that the formatting seems fine. And moving to Perl or PHP is one of the most asinine suggestions I've ever heard. Why would someone want to …

Member Avatar for WaltP
0
433
Member Avatar for MedianHansen

Compilers [url=http://www.codeblocks.org/downloads.shtml]Code::Blocks[/url] [url=http://msdn.microsoft.com/vstudio/express/visualc/]MSVC++ Express[/url] [url=http://www.openwatcom.org/ftp/]Open Watcom C++/Fortran[/url] [url=http://www.bloodshed.net]Bloodshed DevC[/url] [url=http://www.borland.com/downloads/download_cbuilder.html]Borland 5.5[/url] Don't use Vista but they all work on XP.

Member Avatar for people123
0
324
Member Avatar for cl3m0ns

[QUOTE=cl3m0ns;458077]I have this program it allows the users to enter a name and a score it saves all the names to one array and all the scores to another. The program then displays all the names and scores in a list. I want to have the code for displaying the …

Member Avatar for WaltP
0
162
Member Avatar for disc

[QUOTE=disc;457861]The try/catch block is already implemented in the DoIt function but that's not the solution because the exception is caused by a third party DLL. [/QUOTE] Talk to the third party. They have a better chance of figuring out what's going wrong.

Member Avatar for WaltP
0
88
Member Avatar for clski1973

[QUOTE]You could try something like this: (pseudocode) int input, average, total, count; [CODE] while(count++) { ask for input ; if (input == 0) break; // 0 quits te program total += input; average = total / count; } printf ("Total = %d, Average =%d", total, average; [/CODE] You'll have to …

Member Avatar for WaltP
0
145
Member Avatar for Salem

[QUOTE=cscgal;456766]> How about saying that on the search page that you use a heuristic for performance reasons I think that it can pretty much be assumed whenever querying a huge dataset that some level of heuristics are involved. There would be no positive benefit to having such a disclaimer.[/QUOTE] No …

Member Avatar for Dani
0
181
Member Avatar for jonbuckets

[QUOTE=Duoas;457140]All the places where you have something like [inlinecode]/2[/inlinecode] check to make sure your numerator is a double [I]before[/I] division occurs. If it isn't, change your denominator to a double (say, [inlinecode]/2.0[/inlinecode]).[/QUOTE] Or, more generally, make sure at least one of the values being divided is a floating point value.

Member Avatar for jonbuckets
0
96
Member Avatar for mt171406

[QUOTE=mt171406;457259]I am trying to develop a program that reads a list of integers from a file and outputs whether or not each integer in the file is perfect. Its suppose to give practice using endfile-controlled and for loops. [/QUOTE] I'd start by attempting something. Just opening a file and not …

Member Avatar for Aia
0
90
Member Avatar for warpstar

[QUOTE=warpstar;457353][code] _ _ _ _ function2(_ _ _ _ _ _ _ _ _ _ _ ); main{ int n[]= {4, 5, 6}; int *kptr ; kptr = function2( n ) ; } [/code] Fill in the blanks and you get: [code]int *function2( int array[ ]); or int *function2( int …

Member Avatar for WaltP
0
121
Member Avatar for thunderstorm98

Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25.

Member Avatar for Ezzaral
1
872
Member Avatar for garc2541

[QUOTE=vmanes;457053]Double check all your { } pairs, make sure you've not left an open set in main( ). That could lead the compiler to thinking you're trying to declare a function inside a function.[/quote] The easiest way to do this is to learn how to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] correctly.

Member Avatar for WaltP
0
110
Member Avatar for profess69

[quote=profess69;266390]Hello anyone if you see this please reply fast: i need some major help with some programming and logic code through liberty basic, My project consist of making an ATM Program allowing the user to only enter the security code 3 times and it also prompts you to enter a …

Member Avatar for Ancient Dragon
0
335
Member Avatar for DejanL23

You need to describe the error. No one is going to spend an hour trying to find the error, then pour over [I]your[/I] code to fix it. [I]You[/I] need to describe the error and the circumstances with which it happens.

Member Avatar for DejanL23
0
178
Member Avatar for fcleme

Create your program as a [I]Command Line[/I] program, or whatever your compiler calls it. Build it creating an executable. Open a command prompt window [B]Start:Accessories:Command Prompt[/B]. Navigate to the directory -- sorry, folder -- the executable is created in. Enter the name of the executable. IOW -- You edit and …

Member Avatar for Ancient Dragon
0
137
Member Avatar for koolboy

For 25 posts, you sure haven't been listening to posting suggestions. READ THE FAQ!!!! Titles are important READ THE "READ THIS BEFORE YOU POST" STICKY!!! How you ask helps how you are helped READ THE BBCODE STICKY!!! READ THE BACKGROUND ON THE BOX YOU TYPE YOUR MESSAGES IN!!!! How you …

Member Avatar for Ancient Dragon
-1
138
Member Avatar for still_learning

[QUOTE=niek_e;456554]It shouldn't that much of a challenge when you're allready able to write recursion :) - ask a user for input before you call your function - add a 3th var to the function which is the number of times the user just entered - in the function count down …

Member Avatar for WaltP
0
129
Member Avatar for liphoso

[QUOTE=liphoso;456004]I have made a few changes but it really still does not do wat i was xpecting[/QUOTE] That's too bad. Unfortunately most of us aren't going to play with the program to try to figure out what it's not doing. You need to tell us what it's doing wrong. This …

Member Avatar for WaltP
0
130

The End.