5,676 Posted Topics
Re: #1- [url=http://www.gidnetwork.com/b-56.html]gets()[/url] is a dangerous function, as you can see by the link #2- If you enter 16 characters, you just blew past your array bounds when [I]gets()[/I] adds the required 0 in the 17th location. #3- change each [I]printf()[/I] so you can tell which one is outputting the junk. … | |
Re: By reading the header of the picture file. Loot at [url]http://www.wotsit.org/[/url] | |
Re: [QUOTE=jbennet;323331]americanisms and american pronounciations get on my nerves we invented the darn language anyways... :)[/QUOTE] But you keep changing it! From Canterbury Tales: [QUOTE]But if I telle tales two or thre Of freres, er I come to Sidyngborne My tale is doon we been almoost at towne Sires, now in … | |
Re: [QUOTE=RaCheer;344115]Hello! I have written written my own class, which includes a header file and a .cpp file. I have also written the driver for this program. Everything looks fine to me, but I am receiving about 20 random errors. I will post my code for all 3 files but I … ![]() | |
Re: [QUOTE=winbatch;344733]Is there a way using file handling functions to search within a text file to find the position of certain text WITHOUT having to read each character/line and evaluating it?[/quote] Is it possible to find a file in a file cabinet without opening the cabinet? No, the only way to … | |
Re: [QUOTE=Duki;344107]This program works unless I input 's' for marital status. Does anyone see my logic error?[/quote] You've been here long enough to know that a question like that is worthless here! What the **** does it do wrong? Other than asking for "Marital [I]Satus[/I]" ;) | |
Re: Stop spamming the forum. | |
Re: [code] open output file Use a loop to open input file read input file write to output file close input file end of loop close output file [/code] | |
Re: [QUOTE=thekashyap;343616]Usually if the board is not too big reprinting the whole thing (with spaces where you want a number the disappear) does the trick fast enough.. clear the screen before you print of course.. E.g. [code=c]System("clrscr"); printf( "1 2 3" ) ; Sleep(1000) ; System("clrscr"); printf( " 2 3" ) … | |
Re: When was the last time you looked at the format of a [INLINECODE]scanf()[/INLINECODE] command? And while you're at it, [url=http://www.gidnetwork.com/b-62.html]read this[/url] about [INLINECODE]scanf()[/INLINECODE] | |
Re: [QUOTE=kemboy;343657]it works perfectly but can you show how to return the array name(which is the pointer to the first element in the array) then print and find the average in the main programme.[/QUOTE] No, it's [I]your[/I] job to show us how you think it's done, and we will help you … | |
Re: Stop spamming the forum. Ask your question in one thread when they are all related to the same subject. | |
Re: Show us what you have and we can help you fix it. But do it in an new thread. It's not nice to hijack someone else's thread. | |
Over the past week or so, after hitting [I]submit[/I] and being thanked for my submission (such a nice forum) I get redirected --not to my post -- but to the following page. This has happened on multiple occasions, usually on longish posts. (gee, the spell checker liked longish? How weird) … | |
Re: I was always good in math, and was surprised to learn that in my computing life math was rarely needed beyond the basics. When we needed higher math we were generally given the equation which had to be translated into code, but that wasn't too hard. Pretty straight forward most … | |
Re: The problem is on line 15 and 22. Unless my psychic powers are mistaken... :rolleyes: | |
Re: [QUOTE=RisTar;343554]1. For some reason randomize() function does not work on VisualC++6[/QUOTE] That's because this is C++, not Basic. You 'randomize' using [INLINECODE]srand(time());[/INLINECODE] once at the start of the program. Be sure to include [I]time.h[/I] | |
Re: Standard C++ means they are using the normal functions and methods as defined by the Standards Committee that basically laid out the language. Each compiler will allow the standard functionality as described by said standard. Compiler designers also add additional functionality that is not standard, and [I]that[/I] is what you … | |
Re: Mostly what [B]vijayan121[/B] suggests a. read one line b. analyze each character c. do what you need with each character repeat a,b,c till end of file. [code] string line ; while( getline( file, line ) ) { for (i=0; i < line.length(); i++) { if (line[i] ...) // look at … | |
Re: [QUOTE=chikwava;342651]hy !!I ope yu r woking hard to help me out. I tried all i could but couldn't get an far. I need help please[/QUOTE] Yeah, I'm sure most of us are just about done with your homework. | |
Re: [url=http://www.dinkumware.com/manuals/?manual=compleat&page=index.html]Here's another[/url] good place. | |
Re: Is [I]flip[/I] some technical term in computers I've never run across? You need to use words that actually describe the symptoms. | |
Re: [QUOTE=joeprogrammer;342371]>Is there a way I can cin Mon, skip char, cin Day, skip char, cin Year ? Too complex for [inlinecode]cin[/inlinecode], way easier with [inlinecode]getline()[/inlinecode]. Just use it to grab the entire line, and then parse out the numbers in between the tokens (perhaps use [INLINECODE]strtok[/INLINECODE]?)[/QUOTE] Not really. It's not … | |
Re: Please [url=http://www.gidnetwork.com/b-38.html]read this[/url] so we can read your code easier. | |
Re: Depends totally on the compiler and the operating system. There is no standard way to do it. | |
Re: They don't have an extension. They are a specific location on the disk that when the computer is booting, if that sector has the correct format, the system uses it for the boot. | |
Re: [QUOTE=Tauren;342206]Ur right, If you had a server and maybe the data base which holds the items you wouldnt want the server holding the item before you got it I guess I will always just use i++[/QUOTE] [QUOTE=Tauren;342208]I just dont fer what the statments do? whats the diffrence? /code for (int … | |
Re: Jimmy, please [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_clean]read this[/url] about the language we speak here, please. | |
Re: Calvin & Hobbes Wizard of Id Arlo & Janis Dilbert Peanuts Bloom County | |
Re: [QUOTE=ft3ssgeek;341788]How about just running the code from the command line?[/QUOTE] Most people have no idea what the command line is, unfortunately. And doesn't it defeat the purpose of using an IDE that allows editing, compiling and running the program to pop out of it after editing and compiling just to … | |
Re: Because the government added tax to the calculation.... :p Actually, because you never calculated [I]overchargeTime[/I]. You mistyped the equation for that calculation. | |
Re: In other words, every time you output a value, add 1 to a counter. When it reaches you 'magic number' exit the loop. | |
Re: C and C++ know nothing about how the screen and keyboard actually work, so there's no provision in the languages themselves to accomplish what you want and have the program portable -- which is the one good reason for using C/C++. | |
Re: [QUOTE=DEMWilson;341588]True but he should be able to get the point and fix it. Thanks though I didn't think of those things.[/QUOTE] Another thing you didn't think about is if you do someone's homework for them, they learn nothing, but get a passing grade anyway. Please help them [I]find[/I] the solution, … | |
Re: Read a bunch of posts here and you can see what we can help with, and also what you should not post. | |
Re: [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]See this[/url], paragraph 3, and [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]this[/url] | |
Re: [QUOTE=ithelp;340781]Hello C/C++ experts, I write the following code [code] int a[10]; int b[10]; // initiliaze all element of array a and b to 0. a[11]=255; [/code] Neither the program crashes nor the value of b[0] becomes 255 What could be the reason?[/QUOTE] Because 1) in some (most?) compilers the variables … | |
Re: Are all your lines formatted exactly like you specified, with 5 numbers? If so, Just duplicate the two reads instead of using the DO loop. Or if you need to use a loop, make it a FOR loop and just loop 2 times. Also, [url=http://www.gidnetwork.com/b-58.html]see this[/url] about your use of … | |
Re: [QUOTE=marlon ng;340140]I'm a beginner so pls bear with me. Try to make your explanations as simple as possible. The program i'm going to make will be like this: the user enters the customer name, the items ordered by the customer, the quantity of those items, and their prices. Here are … | |
Re: Roach killer. | |
Re: And please [url=http://www.gidnetwork.com/b-38.html]format your code[/url] -- it's really too hard to read. This is at least the third time it's been mentioned. Infractions are costly... ![]() | |
Re: [QUOTE=mrjoli021;340575]srting FirstName[10];[/QUOTE] Do you mean to make 1) an array of 10 [I]strings[/I] 2) a string to hold 10 characters? If 1, you reference the length with [INLINECODE]stringname[index].length()[/INLINECODE] If 2, you create the string with [INLINECODE]char stringname[10][/INLINECODE] then reference the length with [INLINECODE]strlen(stringname)[/INLINECODE] | |
Re: [QUOTE=Aia;340416]>double i,b; Don't use a float or double for index in a loop. Use a integer if you want correct results.[/QUOTE] It is fine to use floats and doubles as loop indecies. [QUOTE=Aia;340449]declaring the integers inside the for loop doesn't work in all the compilers. It's outside of the C99 … | |
Re: [QUOTE=TkTkorrovi;340096]It seems that you like to write some console/terminal applications. Please try to understand me now. Standard C doesn't provide any features for that. Yes it's somewhat stupid to be able to write only some command-line programs, for example, while learning C. [/quote]But it's even stupider to try to learn … | |
Re: [QUOTE=Aia;340621]If you would have to write your own implementation of the function [COLOR=Blue]getchar()[/COLOR] in C; how would you do it?.[/QUOTE] I wouldn't. It a C primitive function and is written to access the keyboard input buffer, which is generally beyond the compiler's capability. |
The End.