5,676 Posted Topics
Re: [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. | |
Re: 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. | |
Re: Sure. [url=http://www.cplusplus.com/reference/iostream/istream/getline/]See this[/url]. | |
Re: Integers don't have decilam places. You'd need to convert the variables to [I]double[/I]. | |
Re: [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 … | |
Re: If you are writing C++ you should be using [ICODE]cout[/ICODE], not [ICODE]printf()[/ICODE] | |
Re: Something tells me Dell doesn't need to spam. The poster was trying to help, you bozos. :icon_wink: | |
Re: [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. … | |
![]() | Re: [CODE]myfunc(&array[0]);[/CODE] This complexity is not necessary. [ICODE]myfunc(array);[/ICODE] is enough. ![]() |
Re: Start by writing some code that inputs the number from the user. | |
Re: [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 … | |
| |
Re: 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 … | |
Re: [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. | |
Re: 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. | |
Re: 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 … | |
Re: [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. | |
Re: 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 … | |
Re: [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 … | |
Re: [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. | |
Re: 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. | |
Re: [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 … | |
![]() | Re: [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 … |
Re: 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. | |
Re: 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 … | |
Re: Create a header file with: [iCODE]extern int array[];[/iCODE] in it and include the header in the .cpp file without the array declaration.. | |
Re: 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] | |
Re: 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... | |
Re: OK. I did it. Where do I send it to get graded? | |
Re: 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 | |
Re: [url=http://lmgtfy.com/?q=linked+lists+c%2B%2B]Try This[/url] | |
Re: [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 … | |
Re: [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. | |
Re: 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 … | |
Re: 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. | |
Re: [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 … | |
Re: 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 … | |
| |
Re: Wasn't the offending line [iCODE]Triangle(int side1,int side2,int side3);[/iCODE]? Why is it still in the code? | |
Re: [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. | |
Re: 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: | |
Re: 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] | |
Re: 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. | |
Re: [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 … | |
Re: [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 … | |
Re: Use some of the programs you had to write when you learned C++. | |
|
The End.