5,676 Posted Topics
Re: Where is [iCODE]strdup()[/iCODE] defined? How is it defined? It's not an ANSI function. | |
Re: So the text "Has this thread been answered?" held no meaning. And the text just below it was unreadable.... | |
Re: So you don't think the error itself is worth knowing, just that the box itself jumps out. You probably go to the store and buy unlabled cans of food, too. | |
Re: You mean none of this is explained in the help nor at the home page? There's no documentation at all? Somehow I don't believe that... | |
Re: I would guess that it's because you have no data to display. Where is [B]myarray[/B] loaded? | |
Re: First post -- CODE Tags [B]and[/B] formatted! Such a wonderful thing to see! One tip - change your IDE to replace TABs with 4 SPACEs instead. Notice hoe the end of your code gets lost in line-wraps. It's also easier to read in general. Your program as written should exit … | |
Re: How many different answers are you expecting? If you get three different answers, which one do you choose? Doesn't having multiple answers give you more problems? And if you only get one answer from three different sites, who just wasted the time of people on two sites? Why do you … | |
Re: In the function definition: [iCODE]void All_Grades::grade_set(class_percent)//needs to take class_percent [/iCODE] what [B]type[/B] is [I]class_percent[/I]? Don't you need to specify? | |
Re: [B]Moschops[/B] is saying you program the computer to do the same thing [I]you[/I] do without the computer. What's your first guess? Make the computer to the same thing. | |
Re: We have no idea what you are talking about. Details and examples, please. | |
Re: We have [B]flag bad post[/B]. We have [B]infractions[/B]. We have [B]rep[/B]. Maybe we need a button for [B][COLOR="Red"]whiner[/COLOR][/B]! | |
Re: It also depends on the compiler, too. Most compilers can't do it. In your case, I would guess it's VC++ something, so [I]getch()[/I] would work. | |
Re: What do you want it to look like? A line of * or @ could be used. | |
Re: [QUOTE=jimmymack;] Because using getline() as in this example terminates the input read once it hits a newline (by default), 'you have to make sure no extraneous input exists in the buffer prior to calling it'.????? For example, if you read in an integer, then a whole line, the user may … | |
Re: [B]zgesv_[/B] is a variable or function you tried to use but didn't define. Hence "[I][U]undefined[/U] reference[/I]" | |
Re: Since this is a school project, and very obviously you haven't learned vectors, make an array of your class [B]product[/B] and you can fill each [B]product[/B] with your data. | |
Re: You didn't set up the config files. Assuming the [I]bin[/I] directory is [iCODE]C:\Program Files\Borland\BCC55\Bin\[/iCODE], create these two files in the [I]bin[/I] directory: [B]BCC32.CFG[/B] -I"C:\PROGRA~1\Borland\BCC55\Include" -L"C:\PROGRA~1\Borland\BCC55\Lib" [B]ILINK32.CFG[/B] -L"C:\PROGRA~1\Borland\BCC55\Lib" | |
Re: [QUOTE=Violet_82;] Ok, so I don't quite understand how the [CODE]srand()[/CODE] function is used, (line 34 of main) in combination with the functions [CODE]rand()[/CODE] line 48 and 49. Why do we need [ICODE]srand()[/ICODE] in this program, isn't [ICODE]rand()[/ICODE] enough? thanks[/QUOTE] See [url=http://lmgtfy.com/?q=srand]this[/url] and [url=http://lmgtfy.com/?q=rand]this[/url] | |
Re: What keys -- all of them -- are you hitting when you answer the question? Isn't it [iCODE]n[ENTER][/iCODE]? If so, your code reads the [iCODE]n[/iCODE], correct? What happens to the [iCODE][ENTER][/iCODE]? Well, the next input gets it and does what it's supposed to do. Exit. You need to clear out … | |
Re: Explanation of task - check Current code - check Explanation of what you have trouble with - nonexistent Therefore - requesting us to read your code, understand what you did, try to correlate it with the task list, and try to figure out what you don't understand, and finally tell … | |
Re: Didn't [B]Dave[/B] answer you well enough 4 hours ago on the other site? Was there something you didn't understand? | |
Re: I agree. [B]AD[/B] commented as he saw it, explaining why he would suggest not doing it. Then you became belligerent and condescending. | |
Re: [QUOTE=charchar88;]I also discovered I have to precede every '*' symbol with a \ to do the multiply i.e. [B]./test 7 10 \*[/B] rather than just [B]./test 7 10 *[/B]otherwise it starts printing out stuff I don't want. If I don't use the \, argv[i] would also print out my file … | |
Re: Looking back on your code, #1 is stop using TABs to indent. Use 4 SPACEs. Your IDE can be set to convert TABs to SPACEs. And be more consistent with your indentation. [url=http://www.gidnetwork.com/b-38.html]See this[/url]. Also, before you even touch the computer, design the program in pieces on paper. Take each … | |
Re: Try reading your Private Messages. They are explained in the messages. | |
Re: Never never NEVER [B]NEVER[/B] change [iCODE]argv[][/iCODE] values. They are command line inputs, not to be modified by the program. Copy them to an internal buffer. If you use [ICODE]strPointer 10 7 +[/ICODE] then [ICODE]argv[1][/ICODE] = "10" [ICODE]argv[2][/ICODE] = "7" [ICODE]argv[3][/ICODE] = "+" You might want to read [url=http://www.gidnetwork.com/b-45.html]this series[/url] if … | |
Re: Change [I]cout[/I] to [I]printf[/I] Change [I]cin[/I] to [I]scanf[/I] Change to the proper headers for C Post using CODE Tags. | |
Re: [QUOTE=hawita;]i am trying to write a program to play the Battleship game;It is not a homework problem just a practice problem.[/QUOTE] Good program to practice on. Well done. [QUOTE=hawita;]The instructions are: set up a coordinate grid, select your own ships and locations while the computer selects its own; launch missiles … | |
Re: Add a ; after your keytab structure. On line 13 you don't have a type name (like [iCODE]int keytab[][/iCODE]) | |
Re: So what does your output mean? What's wrong with it? Just posting a bunch of numbers with no explanation makes it impossible to help. | |
Re: Why would you want to [B]strlen()[/B] and integer? What is [B]strlen()[/B] used for? What is it that makes a 7 digit number different from, say, a 4 digit or 8 digit number? But, if you are going to have a pin value ready for them to match, who cares if … | |
Re: It is close to impossible to answer a question that is not asked. And you didn't ask one. So, we don't know what to help with... | |
Re: Do you want to change an unsigned int into a signed negative number? | |
Re: [QUOTE=pywriter;]I know the how to fill a magic square but there is a problem in the code.[/quote] We don't... [QUOTE=pywriter;]The algorithm is like below: 1-Put number 1 at the second column of first row. 2-Put the next number one upper row and one behind column. 3-If the cell mentioned in … | |
Re: I don't think anyone has noticed, but the assignment doesn't mention [B]string[/B] nor [B]character array[/B] anywhere. Where did you get the requirement to convert stuff to a string? Why not just read the values as integers and compare? | |
Re: [QUOTE=crunchie;]You must first go without sleep for 36 hours before being subjected to numerous hard-hitting questions like 'What you did last Summer'...[/QUOTE] But I already know what you did last summer! :icon_twisted: | |
Re: #1) Why are you using a [B]string[/B] to hold 1 hex character. Use a [B]char[/B]. #2) Make a loop instead of 16 nested [B]IF[/B] statements. #3) Why are you taking the substring of [B]convert[/B] and loading it into [B]convert[/B]? Isn't that like digging a hole and putting the dirt in … | |
Re: [QUOTE=abhimanipal;]PS I hope you have malloced memory for max[/QUOTE] Why? Can't you just create the variable using [ICODE]double max;[/ICODE] and pass in the address? | |
Re: Of course. The Psychic Programming InterNetwork will get right on it. The problem is on line 36. | |
Re: Problem I see is an over complex concept. Why dynamic arrays? They are harder to deal with and your plane size is fixed. How about [iCODE]seating[12][4][/iCODE] to make it easy on yourself. Note your instructions say "[I]The data structure that is used to store Passenger objects must be array.[/I]" No … | |
Re: use [iCODE]cout[/iCODE]'s to follow your program: Is your input completely correct? Display what you read and verify it's accurate. Is your sort testing the correct values? Again, display what you are testing and at least whether or not the values get swapped. You probably don't need to display each value … | |
Re: I guess by Reading lines that are not blank and stopping when a blank line is read. Process the lines read. Start again. | |
Re: [QUOTE=aamira_s;1530903]This program is to count the number of words,vowels and consonants of a string.Here is my code.Please post your comment.I do not know whether I need to change anything. [/quote] [CODE] IF (code works as expected) why would changes be needed? else changes are needed [/CODE] Now if you have … | |
Re: How is this spam? Just looks like a worthless post to me, not spam. | |
Re: [QUOTE=fadi_1234;1528821]this game is between a player and computer can you make it between two player please ?[/QUOTE] That would be your job. If you have working code to begin with. |
The End.