5,676 Posted Topics

Member Avatar for spacecowboy123

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

Member Avatar for WaltP
0
168
Member Avatar for Kees Baltus

By reading the header of the picture file. Loot at [url]http://www.wotsit.org/[/url]

Member Avatar for Kees Baltus
0
290
Member Avatar for carolraydon

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

Member Avatar for hbk619
0
389
Member Avatar for RaCheer

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

Member Avatar for iamthwee
0
173
Member Avatar for winbatch

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

Member Avatar for vijayan121
0
364
Member Avatar for Rashakil Fol
Member Avatar for Duki

[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]" ;)

Member Avatar for Duki
0
123
Member Avatar for victor Thomas.D
Member Avatar for raj157

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

Member Avatar for vijayan121
0
314
Member Avatar for it_dude

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

Member Avatar for thekashyap
0
95
Member Avatar for CRD

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]

Member Avatar for WaltP
0
213
Member Avatar for kemboy

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

Member Avatar for WaltP
-1
281
Member Avatar for victor Thomas.D
Member Avatar for victor Thomas.D
Member Avatar for victor Thomas.D

Stop spamming the forum. Ask your question in one thread when they are all related to the same subject.

Member Avatar for WaltP
0
88
Member Avatar for Dani
Member Avatar for ravenous

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.

Member Avatar for WaltP
0
1K
Member Avatar for WaltP

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

Member Avatar for The Dude
0
107
Member Avatar for The Dude

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 …

Member Avatar for J_M44053
0
407
Member Avatar for example303

The problem is on line 15 and 22. Unless my psychic powers are mistaken... :rolleyes:

Member Avatar for John A
0
89
Member Avatar for RisTar

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

Member Avatar for WaltP
0
226
Member Avatar for Mpiangu

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 …

Member Avatar for jwenting
0
127
Member Avatar for B.Y

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 …

Member Avatar for WaltP
0
10K
Member Avatar for chikwava

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

Member Avatar for naya22
0
97
Member Avatar for CRD

[url=http://www.dinkumware.com/manuals/?manual=compleat&page=index.html]Here's another[/url] good place.

Member Avatar for Mpiangu
0
103
Member Avatar for nottoshabi

Is [I]flip[/I] some technical term in computers I've never run across? You need to use words that actually describe the symptoms.

Member Avatar for Ancient Dragon
0
324
Member Avatar for Duki

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

Member Avatar for John A
0
244
Member Avatar for ck1212

Please [url=http://www.gidnetwork.com/b-38.html]read this[/url] so we can read your code easier.

Member Avatar for rowly
0
161
Member Avatar for jasssvj

Depends totally on the compiler and the operating system. There is no standard way to do it.

Member Avatar for vijayan121
0
1K
Member Avatar for jacsoft
Member Avatar for jan1024188

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.

Member Avatar for jan1024188
0
87
Member Avatar for Tauren

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

Member Avatar for WaltP
0
131
Member Avatar for Manzar

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.

Member Avatar for WaltP
0
102
Member Avatar for The Dude

Calvin & Hobbes Wizard of Id Arlo & Janis Dilbert Peanuts Bloom County

Member Avatar for arjunsasidharan
1
97
Member Avatar for pc0019

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

Member Avatar for pc0019
0
131
Member Avatar for naya22

Because the government added tax to the calculation.... :p Actually, because you never calculated [I]overchargeTime[/I]. You mistyped the equation for that calculation.

Member Avatar for naya22
0
116
Member Avatar for kjpwa

In other words, every time you output a value, add 1 to a counter. When it reaches you 'magic number' exit the loop.

Member Avatar for ANUJ SHROTRIYA
0
827
Member Avatar for Jedimaster

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

Member Avatar for WaltP
0
34
Member Avatar for Green Anorak

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

Member Avatar for DEMWilson
0
96
Member Avatar for Osama Mehtab

Read a bunch of posts here and you can see what we can help with, and also what you should not post.

Member Avatar for WaltP
0
83
Member Avatar for ssthrissur

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

Member Avatar for WaltP
0
109
Member Avatar for ithelp

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

Member Avatar for vijayan121
0
114
Member Avatar for earlyriser

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 …

Member Avatar for earlyriser
0
80
Member Avatar for marlon ng

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

Member Avatar for WaltP
0
103
Member Avatar for mattyd
Member Avatar for hbk619

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

Member Avatar for iamthwee
1
2K
Member Avatar for mrjoli021

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

Member Avatar for WaltP
0
224
Member Avatar for emr

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

Member Avatar for Aia
0
194
Member Avatar for tasomaniac

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

Member Avatar for TkTkorrovi
0
713
Member Avatar for Aia

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

Member Avatar for vijayan121
0
490

The End.