5,676 Posted Topics

Member Avatar for Ptolemy

[QUOTE=Ptolemy;456139]>I disagree. You have to have all kinds of special code to get scanf() to work properly. Only if you aren't using scanf for what it was designed in the first place. When you have to write workaround code to get a function to work, you're using the wrong tool …

Member Avatar for Dave Sinkula
0
414
Member Avatar for still_learning

[QUOTE=still_learning;456334]Is this an example of a recursive function?? Somebody on another forum helped me put this together, as I am trying to make a diamond shape out of asterisks. But he did not know if this was a correct way of using recursion. Can somebody just tell me yes or …

Member Avatar for WaltP
0
172
Member Avatar for bran-chua

[QUOTE=bran-chua;456402]All the expert, please help me, because my lecturer said this question is difficult, and nobody will do this. so, i want to proof to him that still got expert can do this question...Thanks[/QUOTE] And neither will we. I did this for my class 35 years ago, I don't need …

Member Avatar for WaltP
0
173
Member Avatar for chizy2

Personally (and I'll get slammed for this :icon_wink:) I'd use [INLINECODE]printf[/INLINECODE]. It's designed for formatted output, rather than that convoluted [INLINECODE]cout [/INLINECODE]mess.

Member Avatar for chizy2
0
200
Member Avatar for jobi.tv

Where to get 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] [url=http://msdn.microsoft.com/vstudio/express/vb/]Visual Basic[/url] [url=http://realbasic.com/]Real Basic[/url]

Member Avatar for WaltP
0
93
Member Avatar for megan-smith

[QUOTE=Ptolemy;455607]>Haven't you figure out yet why you should avoid using scanf? I don't think you should avoid scanf. I think you should learn how it works so that you can use it intelligently.[/quote] I disagree. You have to have all kinds of special code to get [I]scanf()[/I] to work properly. …

Member Avatar for WaltP
0
585
Member Avatar for gamingfan1993

#1: [B]Never[/B] bump your messages!!!! People will respond when they see it, and 5 hours is not a long time. #2: If all [I]Basics[/I] are so similar, there is no detail needed. And since you already know they are similar, why are you asking? And where do you get your …

Member Avatar for hopalongcassidy
0
188
Member Avatar for FEARmike21

Details. What works? What doesn't? Specifically what is your problem area?

Member Avatar for WaltP
0
78
Member Avatar for Jobe007

[B]Salem[/B]'s request is to repost your code [B]with[/B] [url=http://www.gidnetwork.com/b-38.html]formatting[/url] and [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]Code Tags[/url]... When we can read the code, we can help.

Member Avatar for WaltP
0
117
Member Avatar for marr007

Define a value for each of the 8 directions: 1-up 2-down 3-left 4-right 5-up/left 6-up/right 7-down/left 8-down/right Then get a random number to decide which direction to choose. Randomly choose a starting location and see if the word will fit 1) enough space in the chosen direction 2) any letters …

Member Avatar for WaltP
0
144
Member Avatar for The Dude
Member Avatar for Lardmeister
0
423
Member Avatar for bobei89

[INLINECODE]if (islower(x))[/INLINECODE] can be written [INLINECODE]if (x >= 'a' and x <= 'z')[/INLINECODE]

Member Avatar for bobei89
0
217
Member Avatar for Alexbeav

Each letter (in fact each character) has a specific numeric value. Each character can therefore be used as an index into an array in which you can increment the appropriate element. Then run through the array when done and output the values you need. Unzip and run the attached program …

Member Avatar for iamthwee
0
503
Member Avatar for Alexbeav

Start by writing a program that accepts parameters on the command line and prints them out. Once that's working, check the parameters to see what they are and output messages for each so you know you are analyzing the parameters correctly. Then open the file, read it, and display it. …

Member Avatar for Dave Sinkula
0
145
Member Avatar for joshSCH

So why can't these 40000 people be deleted? Or is the number helpful in marketing the site?

Member Avatar for thunderstorm98
0
174
Member Avatar for toncoolx

You should not be opening the same file for reading and writing. Use [inlinecode]fout[/inlinecode] to write each line read (changed and unchanged) to a new file. When done, delete the old file and rename the new file. Also, [url=http://www.gidnetwork.com/b-58.html]read this[/url] about [inlinecode].fout()[/inlinecode] (which is identical to [inlinecode]feof()[/inlinecode].

Member Avatar for Ancient Dragon
0
9K
Member Avatar for conan19870619

[QUOTE=Ancient Dragon;453767]If you want to store mixed data than I'd use a structure that has two members: (1) a union between all the data types you want it to support, and (2) an int that indicates what kind of data is stored, such as 0 no valid data, 1 is …

Member Avatar for Ancient Dragon
0
114
Member Avatar for rogenie

[QUOTE=tracethepath;453260]hmm...u dont know the arrays part... i think u cn try this.. . . . hope dis is of sum help[/QUOTE] [QUOTE=tracethepath;453266]sorry i did sum mistake in d above program... below is the corrected one n its working perfectly... . . . i hope it is of sum help...!!![/QUOTE] [B]Trace[/B], …

Member Avatar for Duoas
0
943
Member Avatar for cloudet

#1) You can't use [I]strcat[/I] on [B]strings[/B]. Only with [B]char*[/B]. Look up [B]string[/B] methods. #2) Break the following line into pieces to create the file name and output it so you know it's correct before using the [I]open[/I] function. It's also less confusing. [INLINECODE]infile.open(strcat(strcat(st1,(strcat((string)i,st2))),ios::in) [/INLINECODE] #3) [url=http://www.gidnetwork.com/b-58.html]Read this[/url] about the …

Member Avatar for Ancient Dragon
0
5K
Member Avatar for gator6688

How many threads are we working with for this program? Maybe you should have only one thread so no one gets confused. Especially you.

Member Avatar for WaltP
0
96
Member Avatar for coolbreeze
Member Avatar for WaltP
0
125
Member Avatar for gator6688

[QUOTE=gator6688;452997]The program will stop if any other integer is entered except 1-4. My next question is this. Is there a way to ask the user to reenter the number instead of just ending the program?[/quote] Yes. You put the input in a [I]while[/I] loop and don't exit the loop until …

Member Avatar for WaltP
0
103
Member Avatar for restrooms

[QUOTE=Salem;452727]And would it kill you to use some indentation (or indeed any white space).[/QUOTE] Exactly. [url=http://www.gidnetwork.com/b-38.html]Study this[/url].

Member Avatar for WaltP
0
137
Member Avatar for Exsiss

Why is [I]LetterToMatch[/I] defined as an array of one [I]char[/I]? Why not just define it as a [I]char[/I] and it won't be a pointer, correcting some of the errors.

Member Avatar for Narue
0
316
Member Avatar for jacksonwee

Is there something about the background text you didn't understand on the input box. or the [B][I]Read Me: Read This Before Posting[/I][/B] link at the top of the forum?

Member Avatar for WaltP
0
88
Member Avatar for dukedoc

Write another function that simply prints out the double values by converting to ints. Then at all places you output the values, call the function instead.

Member Avatar for WaltP
0
349
Member Avatar for sneha_venky

So [B]Clinton[/B], what was the purpose of your post? How does it help [B]sneha_venky[/B] with figuring out a project to program?

Member Avatar for vijayan121
0
218
Member Avatar for gator6688

[QUOTE=gator6688;445819]Can someone tell me what i'm doing wrong:[/QUOTE] Depends on what you're trying to do, what it actually does, and what it's supposed to do. [QUOTE=gator6688;445819]Can someone tell me what i'm doing wrong:[/QUOTE] [url=http://www.gidnetwork.com/b-38.html]Formatting[/url] for one. Explaining nothing for two. Not posting errors for three. [url=http://www.daniweb.com/techtalkforums/thread78223.html]Read this[/url] for further help.

Member Avatar for Narue
0
158
Member Avatar for jrice528

[QUOTE=jrice528;445325]I read in the binary form "011010"[/quote] As a [I]string[/I] or a [I]number[/I]? [QUOTE=jrice528;445325]I having trouble getting it into digits, [/quote] This depends on the answer above. [QUOTE=jrice528;445325]and assigning that digit the value in decimal form.[/quote] Explain what [I]decimal form[/I] means -- with an example. It would really help if …

Member Avatar for WaltP
0
123
Member Avatar for gator6688

[QUOTE=Ancient Dragon;445713]not necessary, just declare another int named [b]count[/b] , initilize it to 0, then increment it in that loop maybe something like this: [code] for (i=0; i < MAXGRADES; i++, count++) [/code] Then replace [inlinecode]for (i=0; i<MAXGRADES; i++)[/inlinecode] with this [inlinecode]for (i=0; i<count; i++)[/inlinecode][/QUOTE] Or to make it simple, …

Member Avatar for WaltP
-1
113
Member Avatar for thundaga

Look closely at one of the errors: error C2664: 'read_data' : cannot convert parameter 1 from '[B]double[/B]' to '[B]double [][/B]' The prototype says: [code] int read_data(double angles1[],double angles2[]); [/code]The first parameter requires an [I]array of doubles[/I] When you call the function: [code] int numpts = read_data(angle1,angle2); [/code] what type of …

Member Avatar for Ancient Dragon
0
132
Member Avatar for kako13

Your problem is using the wrong way to test for the end of a file: [CODE]while ( !myfile.eof() )[/CODE] [url=http://www.gidnetwork.com/b-58.html]See this[/url] ([INLINECODE]feof()[/INLINECODE] is the same as using [INLINECODE].eof()[/INLINECODE])

Member Avatar for Narue
0
1K
Member Avatar for zandiago

[QUOTE=zandiago;442356]The assignment is : This is so crazy, here is what I've got so far: [/QUOTE] So what is it you need help with? You need to ask a question so we know what you need help with. Just posting unfinished code and the assignment says "finish this for me, …

Member Avatar for zandiago
0
195
Member Avatar for nsesem

[QUOTE=nsesem;444513]i do need help..someone to help me et tell what to do? thanks[/QUOTE] Sure... [url=http://www.daniweb.com/techtalkforums/thread78223.html]Read This![/url]

Member Avatar for zandiago
0
114
Member Avatar for geekychick

A couple problems with your functions: [CODE=c] int readBig(int[]) // what's the variable name being passed in? { // same with addBig() string num; int n[MAX_DIGITS],i; cin>>num; for(i=0;i<MAX_DIGITS;i++) // what if you enter less than MAX_DIGITS digits? { n[i]=num[MAX_DIGITS-1-i]-'0'; cout<<"n["<<i<<"]"<<n[i]<<"\n"; } // This is an INT function -- you must …

Member Avatar for geekychick
0
147
Member Avatar for gator6688

It's because [B]cin >>[/B] leaves junk in the input buffer when the command is finished. Use [B]getline()[/B] instead, but you will have to remove the trailing '\n' that's in the string you read, which is an easier problem to deal with, IMAO.

Member Avatar for Salem
0
129
Member Avatar for kemboy

As a simplistic explanation, each time you call the recursive function, a [I]new[/I] copy of the function is created, including new variables. The values of the variables in the previous copy are not destroyed, so when the new function returns, the values are as they were before the call was …

Member Avatar for Salem
0
92
Member Avatar for wicked357

So why not use [code] cout << "The first and third letters in the entered words are: " << static_cast<unsigned char> list[1][1] << list[1][3]; [/code] to display the 1st and 3rd letters of word #2?

Member Avatar for twomers
0
117
Member Avatar for megan-smith

[QUOTE=megan-smith;442598]hey there; i wanted to write a program to convert binary to decimal. i did that using the " character approach". it works just fine. then i decided to enhance the program by adding an error message whenever the input are invalid (i.e anything other than 0, 1 ), but …

Member Avatar for Salem
0
126
Member Avatar for gator6688

[QUOTE=gator6688;442602]Any suggestions? Anyone?[/QUOTE] Yes. 1) Use code tags as explained on the background of the box you typed you messages in, as well as in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]the Forum Rules[/url] 2) Don't bump your threads. It's rude, and most of us have lives outside of DaniWeb. We'll get to your problem when …

Member Avatar for Ancient Dragon
0
310
Member Avatar for BigFormat

Since 'A' is the internal value 65, 'B' is 66, 'C' is 67, and so on, subtracting 'A' from your letter will give you 0, 1, 2, and so on. Therefore: [code] int idx; int notalpha=0; int nchar[26]; for (...) char[i] = 0; //set each char to 0 while (c …

Member Avatar for Salem
0
435
Member Avatar for Narue
Member Avatar for royaloba

[QUOTE=royaloba;284714]Veena, thanks, you've solve my 2nd problem, but still my main problem is if i will download all the attendance from the reader it will save only in one file..this is the sample output file... the file name is base on the date i download the file...12052006.txt it should be …

Member Avatar for christophertheo
0
203
Member Avatar for ziz_300

[QUOTE=ziz_300;440284]well in the function "add" I want to add "b" to the specified number, and in the function "deal" I want sign "y1" to "b" in "add", so that "y1" will also be added to the number, and the same thing goes for "y2". but if I put in function …

Member Avatar for WaltP
0
88
Member Avatar for pop007

Here at [B]DaniWeb[/B], we perfer to: 1) use code tags when posting code 2) read the rules so you know how to post 3) not give ready-made programs but help people learn how to program 4) post [I]good[/I] code when helping, not bad code, like: [url=http://www.gidnetwork.com/b-43.html]getch()[/url], [url=http://www.gidnetwork.com/b-66.html]void main()[/url], [url=http://www.gidnetwork.com/b-38.html]proper formatting[/url], …

Member Avatar for WaltP
0
106
Member Avatar for DeathEvil

[INLINECODE]strstr()[/INLINECODE] does not work on [INLINECODE]string[/INLINECODE] class, only [INLINECODE]char*[/INLINECODE]s. Look at the [url=http://www.cprogramming.com/tutorial/string.html]string class[/url] methods to find your substitute function/method.

Member Avatar for DeathEvil
0
161
Member Avatar for rjc

[QUOTE=rjc;435695] basically, when i try to insert a number for minutes, such as 73.5, it will say 1 hour and 13 minutes late, leaving off the .5 .....thank you for all your help[/QUOTE] First of all, why would you want to keep track of .5 minutes? Make them all [INLINECODE]int[/INLINECODE]s, …

Member Avatar for WaltP
0
96
Member Avatar for maverick786

[QUOTE=maverick786;432618]I am having trouble formatting my output of decimal to binary conversions...[/QUOTE] Wouldn't it be beneficial to let us know what kind of problem you are having? The output you posted is correct.

Member Avatar for Salem
0
95
Member Avatar for zite.1

[QUOTE=zite.1;433158]can someone tell me how to find dummy tutorials on how to compile and run C programs using a text editor and the Command Line Window.[/QUOTE] You don't really need one. Type in the command you use to edit a program. When the program is ready, type in the command …

Member Avatar for Narue
0
112
Member Avatar for jarv

[B][I]another error need help please[/I][/B]??? Is that the type of title suggested by the [B]Read This[/B] thread at the top of the forum? And is the information you gave adequate for our understanding, as the same post suggests?

Member Avatar for WaltP
0
105

The End.