5,676 Posted Topics
Re: How about Aussies and Kiwi's? They speak English (sorta)... :icon_smile: | |
Re: [QUOTE=nezachem;]Sorry, you are all wrong. You may have as many mains as you want, provided they are all static (except one, of course). I am not even talking about dll tricks.[/QUOTE] Show us you proof -- with working code compilable on any C compiler. | |
![]() | Re: [QUOTE=francis25;]now what do you think is wrong with my new code???[/QUOTE] As always, you aren't using CODE Tags. Also, give a [I][B]detailed[/B][/I] description of what is happening wrong. Each time you post, [I]explain[/I]! With CODE TAGS! ![]() |
Re: Where you got the idea ^ means [I]raised to the power[/I] in C is a great question. Belaying that, look in the [iCODE]math.h[/iCODE] header for the function [iCODE]pow()[/iCODE] | |
Re: Look up [iCODE]strncpy()[/iCODE]. Wouldn't it be easier to copy the [I]end[/I] of the string instead? That way you don't have to copy the beginning and move the end of the original to the beginning. | |
Re: You need to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] before posting... No idea what you are asking. Distinct prime factors? Of what? Show us an example... | |
Re: [QUOTE=Lerner;560206]BTW: this program is written in pure C and may be better located on the C board than the C++ board. [/QUOTE] It was. He spammed the forums with this problem | |
Re: Both answers have the same problem: 1) way too complex for the question asked. This whole program from [iCODE]main()[/iCODE] to [iCODE]return[/iCODE] can be written in less than 12 lines. 2) Seems to be full working code which means cheating! And we do NOT condone cheating. On these forums we [I]help[/I], … | |
Re: [QUOTE=yoshitsugu;]Can anyone fix my problem? [/QUOTE] No, that's [I]your[/I] job. We can point out where you went wrong... [QUOTE=yoshitsugu;]I'm sure my getDate function algorithm was right, but it still wrong.. [/QUOTE] ... if you'd bother to tell us how you know it's wrong. With the info you gave we don't … | |
Re: To change something you need an equal sign. | |
Re: Another problem. You have a pointer for [i]name[/i] but you have no storage space. You must declare space to actually store the name. And [url=http://www.gidnetwork.com/b-56.html]read this[/url] about [iCODE]gets()[/iCODE] | |
Re: 1) Why are you entering a [I]single[/I] input and calling the convert function on that single input? 2) In the convert function, why are you testing the array just to find the size, then going through an identical loop structure to test/convert each character? Use 1 loop. 3) In the … | |
Re: [QUOTE=pato wlmc;]Well, i'm really new into programming...[/QUOTE] Which is why I'll suggest the 'beginners' way for your 2nd question. 1) [ICODE]vectors[/ICODE] -- beginners never learn vectors early on. Use arrays as you've done. 2) [ICODE]new/delete[/ICODE] -- generally also beyond the beginner's grasp. Your solution to use [ICODE]studentName[100][/ICODE] was the correct … | |
Re: [QUOTE=Truesteel;]It takes the initial balance and will let me input a credit or a debit but the part where it is supposed to display a new balance after each deposit is where I am getting some trouble.[/QUOTE] Then you didn't program the thing right. You said you're "[I]getting some trouble[/I]", … | |
Re: [QUOTE=jonspeidel;] -if i cant call main, how do i make it start from the top of main if they type incorrectly?(tried *main(); and &main(); also, if thats considered calling main i will not do it anymore)[/quote] Let's restate the problem... How do you [I][B]loop[/B][/I] back to the beginning of the … | |
Re: Do not resurrect an old thread to ask a question. You should only post help to an existing thread. Now go start your own thread and reword your question giving us all the detail necessary for understanding exactly what you want. | |
Re: [iCODE]5/9 = 0[/iCODE] so you are multiplying by 0. | |
Re: Change [iCODE]char det = *test;[/iCODE] to [iCODE]char *det = test;[/iCODE] | |
Re: 1) Why calculate the [I]denom[/I] and [I]power[/I] values from scratch each time? Just add 2 each time through the loop. 2) How does [iCODE]sign*power/denom;[/iCODE] equate to [iCODE]x^5/5[/iCODE]? Where's your [B]x[/B]? Where's [B]x^5[/B]? | |
Re: [QUOTE=CronosAkroma;]ok so here the problem the code works just adds break on to every line i want it to only add breaks to the line that don't alraedy have spaces after them.[/QUOTE] OK so you say you have a problem then you say the code works and it just does … | |
Re: Change your IDE/Editor to convert TABs to SPACEs. That will solve the problem... | |
Re: Same with clubs organizations scheduled group dinners AA Meetings IOW, that's how life works... :icon_wink: | |
Re: Are you executing the code by hand to see what happens with the number that doesn't work? Follow each statement with pencil and paper and write down each variable and watch it change. You should find out where it goes wrong. | |
Re: If you enter ^v or backspace, you can display the integer value of the keys to find out what to compare the key value to. | |
Re: [QUOTE=MasterGberry;]I did this....simple but works [CODE]int main() { char c1, c2; c1 = getchar(); // get first input c2 = getchar(); // get second input if (c1 == '\n' && c2 == '\n') // if post inputs are enter exit(1); // exit }[/CODE][/QUOTE] So what happens if someone types in … | |
Re: Two things I see: [ICODE]for(jj=0; jj< (n-(1-j)); jj++) /* inner loop and compares adjenct items */ [/ICODE] I don't believe [ICODE]jj< (n-(1-j));[/ICODE] is doing what you want. Try calculating values of [B]jj[/B] using various values of [B]j[/B]. Are you assigning or comparing [B]cnt[/B] in this IF statement? [CODE] if (cnt … | |
Re: If you are using [iCODE]fwrite()[/iCODE] you should probably be using [iCODE]fread()[/iCODE], not [iCODE]fgets()[/iCODE] | |
Re: They are backup files, generated when you edit your source file. Every time you save a file, the original file before the edit were made is renamed .BAK so if you made a mistake you can 'undo' your errors and start again. | |
Re: C'mon, guys, think! Any guesses what [iCODE]fscanf(fp, [B]"%d"[/B], &bInt);[/iCODE] might do? | |
Re: Other than minor formatting and C++ in the title (what forum is this?), your first post is quite good. What constitutes the beginning of a sentence? How can your program recognize it? | |
Re: Just for clarification, are you asking [I]us[/I] to fix the code and give it to you? | |
Re: [url]http://en.wikipedia.org/wiki/Main_function[/url] | |
Re: You are using the size of [I]full[/I] to test characters in [I]temp[/I]. Are you sure [I]temp[/I] has >= characters than [I]full[/I]? Display the values and see. | |
Re: Write one more function to return the number of digits in one of the arrays. Have it return the index of the leftmost digit. Call this function on each array and remember the lowest value (the leftmost digit of the 'largest' value). Pass this value into the print function. You … | |
I (hopefully) can get the normal file displays to show in LIST mode but I see no way to get [I]Save File[/I] or [I]Open File[/I] lists out of Details mode. Any ideas? | |
Re: [QUOTE=jonspeidel;]okay but not only do i need a portable substitute for system("cls"),[/quote] No you don't. There is no reason for a console program to clear the screen. It's actually annoying to the user. And this was mentioned a couple times, just not strong enough for you to hear it, so … | |
Re: [QUOTE=bensewards;]Question 1.will cin.getline()only stream in 1 line, instead of cin >> file, and if so,how do you go about this with alphabetizing.. What I am thinking is: cin.getline() will stream in 1 line, maybe at a time, and then you can call the swapNames function after the first cin.getline(), and … | |
Re: It all boils down to what you need. [ICODE]str[/ICODE] [I]points[/I] to the first character of the string [ICODE]*str[/ICODE] [I]is[/I] the first character of the string [ICODE]str[n][/ICODE] [I]is[/I] the [B]n[/B]th character of the string [ICODE]*str[/ICODE] and [ICODE]str[0][/ICODE] are functionally equivalent [CODE] str[2]---v str ==> FULL MOON *str--^ [/CODE] | |
Re: [QUOTE=djarn;]You need to look at what you are trying to accomplish as you go through your code. [/QUOTE] And it would really help you do this if you [url=http://www.gidnetwork.com/b-38.html]format your code[/url] properly. | |
Re: [QUOTE=elsiekins;] i have tried using [CODE]while(getchar()!='\n');[/CODE] to clear the buffer , is there any other way / method? is there a simpler way to do this ? Thanks[/QUOTE] Can't get much simpler than that... | |
Re: Just open the file in binary mode and read it. Nothing magical or hard about it. You don't need APIs. And in a computer, all values are numbers. And all bases (binary, decimal, hex) are equivalent. For example, if [I]xval=66[/I], all these statements test TRUE:[CODE] if (xval == 66) // … | |
Re: Also, can't read your code. Please [url=http://www.gidnetwork.com/b-38.html]format it[/url] so we can. If we can't understand it we can't help. | |
Does anyone have any idea why 1/3 of the time Win7 will not boot? Sequence is: Dell Inspiron boot screen Blank screen Windows wallpaper screen Blank screen with mouse pointer centered Nothing from then on. Turn off machine. Turn on Boots fine. Usually. Since Windows does not like to show … | |
Re: You are inputting strings and you want the average of them? I guess first you need to explain this: What is the average of "John", "Book", "Table", "Sheila" and "Europe"? Answer that, and we can understand what you need... | |
Re: [QUOTE=JordanHam;][CODE] t[]={1,2,3,4,5,6,7} [/CODE] and I need to remove 4 and 5 and then send the array back through all my functions. [/QUOTE] So when you 'delete' 4 & 5, what does your array look like? [ICODE]t[]={1,2,3,-1,-1,6,7}[/ICODE] -- if so, you can probably figure out how to do this. [ICODE]t[]={1,2,3,6,7}[/ICODE] -- … | |
Re: Create a second array which contains indecies into your array of strings. For example: ArrayList= "0hello", "1axe", "2help", "3nice", "4camper", "5ocean" ArrayPntr= 0,1,2,3,4,5 Now as you test [I]ArrayList[/I] use [I]ArrayPntr[/I] to get at the values: [CODE]for i=0 to 5 if ArrayList[ArrayPntr[i]] .GT. ArrayList[ArrayPntr[i+1]] swap only ArrayPntr[i] and ArrayPntr[i+1] [/CODE] | |
Re: [QUOTE=jonsca;]Go through each element and keep track of the minimum and maximum values as you go. Also, add the element to a running sum and at the end divide by the number of elements.[/QUOTE] Load the first value of the matrix into your min and max variables first. That gives … | |
Re: [QUOTE=jlego;]340,282,366,920,938,463,463,374,607,431,770,000,000 addresses. how do you pronounce that number?[/QUOTE] 340 undecillion, 282 decillion, 366 nonillion, 920 octillion, 938 septillion, 463 sextillion, 463 quintillion, 374 quadrillion, 607 trillion, 431 billion, 770 million |
The End.