5,676 Posted Topics

Member Avatar for zemly

[QUOTE=zemly;1195638]i have written this code but it isnt working properly...... plz check it[/QUOTE] Check it for what? Are we looking for something? I don't understand whay you need us to 'check it' for.

Member Avatar for jwenting
-2
107
Member Avatar for timbomo

You've been asked before to use proper formatting. Your code is an absolute mess. Please [url=http://www.gidnetwork.com/b-38.html]format your code properly[/url] so we can see the flow.

Member Avatar for VernonDozier
0
137
Member Avatar for gregarion

Sure. [url=http://www.cplusplus.com/reference/iostream/istream/getline/]See this[/url].

Member Avatar for NathanOliver
0
143
Member Avatar for gregarion

Integers don't have decilam places. You'd need to convert the variables to [I]double[/I].

Member Avatar for Avatar99
0
83
Member Avatar for deeep

[QUOTE=deeep;1195392]Hi we have a buffer say [COLOR="Red"]char array.[1].[/COLOR]so the size will be 1 byte.[/QUOTE] Why? An array is multiple bytes. 1 byte is a byte, not an array. I have a fleet of cars -- it's a Ford. I have a pride of lions -- his name is Leo I …

Member Avatar for jephthah
0
171
Member Avatar for seaman34

If you are writing C++ you should be using [ICODE]cout[/ICODE], not [ICODE]printf()[/ICODE]

Member Avatar for p.y.
0
157
Member Avatar for Famous16

Something tells me Dell doesn't need to spam. The poster was trying to help, you bozos. :icon_wink:

Member Avatar for jwenting
-1
183
Member Avatar for smackdown164

[QUOTE=smackdown164;1192103]Im have trouble complete on what i have. Looking for some idea's I'm getting a exit error and don't know what to do? Please Help[/quote] With what? Do you have a problem? Did you tell us what that problem is? If you did, I missed it somewhere in the explanation. …

Member Avatar for Nick Evan
1
182
Member Avatar for schwarznavy

[CODE]myfunc(&array[0]);[/CODE] This complexity is not necessary. [ICODE]myfunc(array);[/ICODE] is enough.

Member Avatar for schwarznavy
0
150
Member Avatar for Samoht VII
Member Avatar for hurricane123
Member Avatar for hurricane123
0
95
Member Avatar for attackthis

[QUOTE=attackthis;1191780]what can I do?[/QUOTE] About what? Test the program might be a good idea. [QUOTE=attackthis;1191785]oh and I also need to take the transaction types and subtract from them to put them into all_cents which will be my final average...[/QUOTE] So do it? What have you tried? Show us. I'm not …

Member Avatar for attackthis
0
166
Member Avatar for vmanes
Member Avatar for satimis
Member Avatar for vanalex

Because you cannot access a character array as if it is one thing. You wouldn't expect to do this, would you? [CODE]void swap(int *s1, int *s2) { int *temp; temp = s1; s1 = s2; s2 = temp; }[/CODE] A 'string' is just a character [I]array[/I] that has \0 in …

Member Avatar for WaltP
0
346
Member Avatar for schwab

[QUOTE=schwab;1193505]wow, 123 views, no response, wow...[/QUOTE] No response? Really? What about [QUOTE=Sky Diploma;1192571]Do You Have any idea on how a vector works? [/QUOTE] It seems the no response was on your end, bucko.

Member Avatar for WaltP
0
200
Member Avatar for coding101

Get rid of the "ton of IF statements"... Each character has a value ('0'=48; '1'=49...) To convert a digit character to an [I]int[/I], subtract '0'. [iCODE]num = chr - '0';[/iCODE] Do this for each character entered.

Member Avatar for WaltP
0
131
Member Avatar for R3Slick

Do you have an actual question or do you just like making new copies of your checksum code for the fun of it? You don't have to quote the same post over and over and over. And if we don't know what you want, posting code with not details at …

Member Avatar for R3Slick
0
207
Member Avatar for tarheelfan_08

[QUOTE=tarheelfan_08;1191085]How is this My data file is showing as this when I open in a text pad. -858993460 -9.25596e+061 5.43402e-304[/QUOTE] Are those numbers correct? If so, it may be working. If not, it's not working.

Member Avatar for tarheelfan_08
0
213
Member Avatar for raseru

C++ has nothing to do with making Windows. It barely knows about the console and keyboard. All that windowing stuff is system dependent and C++ simply taps into that system substructure either via API calls, add-on Windowing systems like MFC, OWL, FLTK, and others. So you need to research the …

Member Avatar for Frederick2
1
968
Member Avatar for pixelerator

[ICODE]#include<iostream.h>[/ICODE] -- old, do not use The current header (as of the 1990's) is simply [B]iostream[/B] [ICODE]#include<conio.h>[/ICODE] -- Non-portable, not standard, do not use [ICODE]void main()[/ICODE] -- [B]main()[/B] is an [I]int[/I] function, not a [I]void[/I]. [url=http://www.gidnetwork.com/b-66.html]See this[/url] [ICODE]clrscr();[/ICODE] -- Non-portable, not standard, do not use [ICODE]tnt[i]=atoi(take[i]);[/ICODE] -- Does [B]atoi()[/B] take …

Member Avatar for pixelerator
0
200
Member Avatar for rena0514

[ICODE]strncpy_s(userId, email_address.c_str(), 9);[/ICODE] copies your email domain into user ID. Whatever was there is overwritten. By the way, just use the [ICODE]strncpy()[/ICODE] function. [ICODE]strncpy_s()[/ICODE] is non-standard, non-portable, not a good choice to use.

Member Avatar for Salem
0
186
Member Avatar for 3cats

It looks OK to me. Have you tried the easiest debugging of all? Use [B]cout[/B] to tell you what's happening as you progress through the program. After the switch output a message. After a read, output the data. Stuff like that. Put them where you think the trouble spots are.

Member Avatar for 3cats
0
174
Member Avatar for saggy_rudra

[QUOTE=saggy_rudra;1191240]Hey!! I gotten the hang of C programming, logic design n all.. But am having real trouble understanding C++ concepts... My sems are up in a month! Any suggestions on how do i get it done before that???[/QUOTE] With that lack of specifics, I would suggest a general study harder …

Member Avatar for WaltP
0
149
Member Avatar for Griff0527

[CODE]palindrome(string[1]);[/CODE] is passing a single character into the function. You probably want [CODE]palindrome(&string[1]);[/CODE] since that's what the function is expecting. As for your logic, it's a royal mess. You are expecting the entire string to be available in the function, but never really keep track of the locations you are …

Member Avatar for jephthah
0
775
Member Avatar for yasy

Learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] properly and the error will be readily apparent. After that, if you need more help, you need to tell us what's wrong. We didn't write the code, you did. Explain.

Member Avatar for Adak
0
111
Member Avatar for Idontknowc

As [B]AD[/B] said. Since you are printing [I]non-[/I]printable characters, you can't very well print them, so you have to print something else in it's place. Add the value 'A' to the character [I]if it's < SPACE[/I] and do as The Dragon suggests: [ICODE]putchar(ch + 'A');[/ICODE] Also, PLEASE format your code …

Member Avatar for Ancient Dragon
0
323
Member Avatar for rahul8590

Create a header file with: [iCODE]extern int array[];[/iCODE] in it and include the header in the .cpp file without the array declaration..

Member Avatar for WaltP
0
270
Member Avatar for Muhammadlodhi

Please format your code. Whatever problem you are having can probably be attributed to the fact you can't see what you're doing. [url=http://www.gidnetwork.com/b-38.html]See this[/url]

Member Avatar for jephthah
-2
116
Member Avatar for jeffhorton1965

What two things are wrong with this line [iCODE]scanf("%d", &abc[30]);[/icode]??? hint for 1: you have defined [B]abc[/B] as a character array, didn't you? You need to study the [ICODE]printf()[/ICODE] function closer...

Member Avatar for jeffhorton1965
0
148
Member Avatar for imunk123
Member Avatar for Muhammadlodhi

You need to read and study pointers. [URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]This link[/URL] is a good tutorial -- Ancient Dragon

Member Avatar for Muhammadlodhi
0
123
Member Avatar for jonymanolo
Member Avatar for cotinga
Member Avatar for Nick Evan
0
223
Member Avatar for eggberto

[QUOTE=eggberto;1191847]I've just read a few books on C++ and learned a lot about the language, but the books never mentioned how to add sound and visuals to my programs.[/quote] That's because C++ doesn't actually do graphics or audio. It's simply a programming language. [QUOTE=eggberto;1191847]I "think" that stuff is all stored …

Member Avatar for WaltP
1
313
Member Avatar for Ali Gohar

[QUOTE=Ali Gohar;1191717]i want to make this game....and i need help....in the game computer should play as a second player....and it should also win....is that possible....and is it easy???[/QUOTE] Yes. Except for the [I]win[/I] part.

Member Avatar for WaltP
0
54
Member Avatar for tallygal

After the page in your text that opens the file should be the page that teaches how to read the file. Try that... :icon_rolleyes: [edit] Looking back, it looks like you already know how to read the file. You've done it before. Maybe you should look back to the beginning …

Member Avatar for WaltP
0
206
Member Avatar for Naftel23

You haven't been through 4th Grade math yet? Do you honestly not know how to figure the average of, say, 26,30,37? Hint - 31.

Member Avatar for Naftel23
0
75
Member Avatar for adrawat

[QUOTE=adrawat;1191314]I do not know why every post that i put...there are always controversies..maybe my question was ambiguous..[/QUOTE] The more details you give -- with examples, restrictions, and when/where/what, the less ambiguous your question. Remember, only [B]you[/B] know what you're doing. If you don't explain it to us well enough, controversy …

Member Avatar for WaltP
0
300
Member Avatar for 3cats

When using >> to read something, Only 1 word is read.You'll need to look at other options for reading multiple-word titles. One idea is to read the entire line as a string and find the Price, Quantity, and Discount and convert them. Another idea (easiest) is to reorder the file …

Member Avatar for 3cats
0
168
Member Avatar for benazirshafi
Member Avatar for sah15

Wasn't the offending line [iCODE]Triangle(int side1,int side2,int side3);[/iCODE]? Why is it still in the code?

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Naloth

[code] cout << "Enter Major: " cin << major; major = toupper(ch); cout << "Enter Threshold: " [/code] How do you get [I]major[/I] into [I]cin[/I]? Is your << wrong? And if so, check the next line, too.

Member Avatar for Naloth
0
162
Member Avatar for pinsickle

I've noticed every time someone claims they have an easy or quick question, you can count on a minimum of a week or two of struggle to get the problem figured out. If it was so easy, why do you have to ask? :icon_wink:

Member Avatar for pinsickle
0
118
Member Avatar for Nicko_FaTe_

I'd do something more along the lines of [CODE] IF m >12 or m < 1 then return invalidmonth IF d > 31 or d < 1 then return invalidday etc [/CODE]

Member Avatar for WaltP
0
81
Member Avatar for DCvonB

Your [iCODE]get_days_in_month()[/iCODE] has a major problem. You [iCODE]malloc()[/iCODE] the [I]day[/I] array but never free it, creating a memory leak. You'd be better off just creating the array as a pointer in the [iCODE]main()[/iCODE] function.

Member Avatar for Aia
0
152
Member Avatar for pramoda.ma

[QUOTE=pramoda.ma;1184076]How to copy one 2D-array to another without using loops and library function of C. Not pointers.[/QUOTE] No C function? Write it in ForTran, or Algol, or Pascal, or Cobol. Bliss would be interesting, or Lisp. It would be hard in RPG-II. Maybe assembler -- no, there you'd need a …

Member Avatar for Ancient Dragon
0
5K
Member Avatar for shahab.burki

[CODE]else if(i==4){ strcpy(getdata.p2p_proto, input); //printf("%s",getdata.p2p_proto); i=0; getdata.next=NULL; return (getdata); bzero(&getdata,sizeof(getdata)); } /*else{ printf("Wrong File"); break; }*/ //printf("%s",input); } fclose(fp); }[/CODE] If you get to [I]i=4[/I], where do you close the file? You need to let the loop simply exit and return at the end of the function. And how does …

Member Avatar for jephthah
0
98
Member Avatar for tomtetlaw
Member Avatar for jwenting
0
108
Member Avatar for shahab.burki

The End.