5,676 Posted Topics

Member Avatar for Dani
Member Avatar for jon.kiparsky
0
211
Member Avatar for Utsav Chokshi

[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.

Member Avatar for nezachem
0
244
Member Avatar for FrancisLazo

[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!

Member Avatar for FrancisLazo
0
118
Member Avatar for vineeshvs

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]

Member Avatar for vineeshvs
0
310
Member Avatar for bergqvistjl

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.

Member Avatar for WaltP
0
147
Member Avatar for sambho

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...

Member Avatar for rajanpathak
1
924
Member Avatar for purepecha

[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

Member Avatar for arkoenig
-1
1K
Member Avatar for jubba_us

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], …

Member Avatar for triumphost
0
156
Member Avatar for yoshitsugu

[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 …

Member Avatar for L7Sqr
0
188
Member Avatar for writerervin
Member Avatar for Firedown

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]

Member Avatar for WaltP
0
119
Member Avatar for brendeg

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 …

Member Avatar for WaltP
0
505
Member Avatar for pato wlmc

[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 …

Member Avatar for WaltP
0
3K
Member Avatar for Truesteel

[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]", …

Member Avatar for jonsca
0
620
Member Avatar for jonspeidel

[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 …

Member Avatar for 1ML
0
399
Member Avatar for erictham83

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.

Member Avatar for shiva_202
0
409
Member Avatar for Craftknight
Member Avatar for westony
Member Avatar for westony
0
110
Member Avatar for kayhantolga
Member Avatar for arguav74

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]?

Member Avatar for WaltP
0
895
Member Avatar for CronosAkroma

[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 …

Member Avatar for WaltP
0
111
Member Avatar for jimJohnson

Change your IDE/Editor to convert TABs to SPACEs. That will solve the problem...

Member Avatar for jimJohnson
0
224
Member Avatar for Dannyo329

Same with clubs organizations scheduled group dinners AA Meetings IOW, that's how life works... :icon_wink:

Member Avatar for AndreRet
0
123
Member Avatar for lgonzo

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.

Member Avatar for lgonzo
0
109
Member Avatar for Danny1994

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.

Member Avatar for Danny1994
0
342
Member Avatar for MaDo4

[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 …

Member Avatar for MaDo4
0
2K
Member Avatar for zychos

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 …

Member Avatar for Adak
0
149
Member Avatar for jmeyer

If you are using [iCODE]fwrite()[/iCODE] you should probably be using [iCODE]fread()[/iCODE], not [iCODE]fgets()[/iCODE]

Member Avatar for WaltP
0
104
Member Avatar for himanshusharma

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.

Member Avatar for josephbeluan
0
203
Member Avatar for erogol
Member Avatar for gerard4143
0
4K
Member Avatar for lwb525

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?

Member Avatar for WaltP
0
2K
Member Avatar for biancaW

Just for clarification, are you asking [I]us[/I] to fix the code and give it to you?

Member Avatar for WaltP
-1
84
Member Avatar for MuaazKhalid
Member Avatar for Phaelax
Member Avatar for lexusdominus

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.

Member Avatar for lexusdominus
0
319
Member Avatar for bleedsgreen33

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 …

Member Avatar for bleedsgreen33
0
195
Member Avatar for WaltP

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?

Member Avatar for jRADD
0
182
Member Avatar for jonspeidel

[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 …

Member Avatar for 1ML
0
527
Member Avatar for bensewards

[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 …

Member Avatar for ravenous
0
202
Member Avatar for EMT

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]

Member Avatar for WaltP
0
148
Member Avatar for realproskater

[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.

Member Avatar for djarn
0
172
Member Avatar for elsiekins

[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...

Member Avatar for elsiekins
0
162
Member Avatar for lochnessmonster

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) // …

Member Avatar for lochnessmonster
0
215
Member Avatar for mikecolistro

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.

Member Avatar for WaltP
0
133
Member Avatar for WaltP

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 …

Member Avatar for Vul
0
162
Member Avatar for mackemforever

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...

Member Avatar for melisko
0
154
Member Avatar for JordanHam

[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] -- …

Member Avatar for Fbody
0
160
Member Avatar for gyuunyuu

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]

Member Avatar for Adak
0
1K
Member Avatar for blessed87

[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 …

Member Avatar for WaltP
0
203
Member Avatar for Ancient Dragon

[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

Member Avatar for jlego
1
195

The End.