5,676 Posted Topics

Member Avatar for Karthy

C'mon guys, the answer is simple. [QUOTE=Karthy;936111]why C is a not a object oriented program ?[/QUOTE] Because it was designed as a procedural language. Simple as that.

Member Avatar for 9868
0
124
Member Avatar for Brandon515

[QUOTE=Brandon515;936594]help please ok here is my code [ICODE]void sleep() { energy 100; happy + 20; strength - 1; bladder 70; age + (hour * 8); };[/ICODE] ok? all the varibles are preprocesser defined, you know #define energy 100.[/QUOTE] If this is true, what does the statement [ICODE]100 100;[/ICODE] do? (first …

Member Avatar for Brandon515
0
140
Member Avatar for vinnijain

Since it's a text box, just look at every character in the box and remember the index of each 2 you come across.

Member Avatar for WaltP
0
82
Member Avatar for wesduncan

1) Accept input from the user 2) Open the file 3) Read a line 4) Use [ICODE]strcmp()[/ICODE] to see if the measurement is at the beginning of the line 5a) If not, back to 3 5b) If so, close the file and continue. Also, check out these links: [url=http://www.gidnetwork.com/b-38.html]Formatting C …

Member Avatar for WaltP
0
98
Member Avatar for exia

Nothing wrong. A [ICODE]char[/ICODE] type can hold values from -128 to 127 only, a total of 256 values. So, 321 is too large and the extra basically falls out the end. 321 - 256 = 65 128 - 256 = -128 An [ICODE]unsigned char[/ICODE] can hold values from 0 to …

Member Avatar for Salem
0
130
Member Avatar for abby2589

What statement causes the error? Do you really expect us to search through 200 lines of code we didn't write to find an error that is unknown? Please give us enough details to help you.

Member Avatar for thelamb
0
129
Member Avatar for baula
Member Avatar for DaBunBun
0
137
Member Avatar for gcah

You have a [B];[/B] you don't want at the end of the [ICODE]while[/ICODE] statement: [CODE] while ((c = getchar())!=EOF); if(islower(c)){ ++letter[c-'a'];} [/CODE]

Member Avatar for gcah
0
153
Member Avatar for red_dogexpress

[QUOTE=red_dogexpress;929869]can anyone help please [/QUOTE] Sure. I added the CODE TAGS you ignored, which are described 1) in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] you were asked to read when you registered 2) in the text at the top of this forum 3) in the announcement at the top of this forum titled [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]Please …

Member Avatar for kvprajapati
0
129
Member Avatar for RobBrown

Code tags explained: 1) in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] you were asked to read when you registered 2) in the text at the top of this forum 3) in the announcement at the top of this forum titled [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]Please use BB Code and Inlinecode tags[/url] 4) in the sticky post above titled …

Member Avatar for Dream2code
0
232
Member Avatar for misslb02

If usually starts with headers, then [icode]int main()[/icode]. Then there's an input of some kind. Then you get some [icode]if[/icode] statements with some math intermixed, maybe even a loop or three, and finally some output statements.

Member Avatar for wildgoose
0
98
Member Avatar for jephthah

[QUOTE=niek_e;920621]So with the sudden disappearance of Narue, the moderators are free to do anything the want right? I mean: no control what-so-ever until there's another s-mod? [/QUOTE] Just try it, I dare you! :icon_twisted:

Member Avatar for shadwickman
0
204
Member Avatar for scru

[QUOTE=scru;920312]... but doing something for the sake of the standard where it saves me a bit of effort to do it in another way that works just as well is retarded. [/quote] Makes sense. Let's use this attitude elsewhere in life. Gee, stopping for that red light ahead is just …

Member Avatar for ~s.o.s~
1
527
Member Avatar for ichie06

:icon_idea: Maybe we can all learn from the Ancient one... :icon_wink:

Member Avatar for tux4life
0
109
Member Avatar for jephthah

I called shenanigans and they delivered some Cock-A-Leeky soup and some nice roast mutton.

Member Avatar for ~s.o.s~
0
577
Member Avatar for chaines51
Member Avatar for Se7Olutionyg

Since we know the program you posted cannot possibly compile, and you claim it's actually running, you need to repost the current code you're compiling. And then explain [I]in detail[/I] what the program if doing wrong. Don't make us search for it.

Member Avatar for WaltP
0
163
Member Avatar for crh0872
Member Avatar for makavelixx

Add a do-while loop around the main portions of the code. At the end of the loop simply ask a question. Input the answer and the [icode]while[/icode] conditional can exit the loop or not. [B]But[/B], you should [url=http://www.gidnetwork.com/b-59.html]read this series[/url] about scanf() first. And you might as well read [url=http://www.gidnetwork.com/b-43.html]this[/url], …

Member Avatar for Pavan_
0
278
Member Avatar for nirav99

[icode]kbhit()[/icode] is useful, but using [icode]getch()[/icode] is also required. Understand what [I]both[/I] functions do, and you should be able to figure out how to use them for your program.

Member Avatar for tux4life
0
157
Member Avatar for mshafi

[QUOTE=mshafi;913677]I tried to compile a code written in C which had included the file "graphics.h".It worked fine in my desktop PC which had a VGA monitor.But when i tried to run the same code in my laptop,it showed some graphics error. why is it like this?fG[/QUOTE] [i]Some graphics error[/i] is …

Member Avatar for dng
0
450
Member Avatar for Ancient Dragon

[QUOTE=happygeek;908437]Obviously, maths is not an essential requirement :)[/QUOTE] I agree with that 1000%!!!! :icon_razz:

Member Avatar for WaltP
0
153
Member Avatar for dcm882003

[QUOTE=dcm882003;913106]I understand what you mean by the redundancy but that's what was stated the file reading has StudId, Quiz, Quiz, Quiz, Quiz, Quiz, am reading in 15 rows but the max will be 40. Which is what I need the counter.[/QUOTE] Then you should use a [ICODE]while[/ICODE] loop instead of …

Member Avatar for wildgoose
0
124
Member Avatar for Flyin dagger

[quote]Also, note how the two biggest portion of our debt is due to Liberal politics: Medicare and Social Security. Wow, what an intelligent idea! [quote]Not even close to the truth - where the hell do you get your data. I want links; come on - support your statements![/quote][/quote] [code]1945 [B]Harry …

Member Avatar for Aia
0
783
Member Avatar for thilinam

[QUOTE=adatapost;906011] How to freed allocated memory? [CODE=C++] delete []p; [/CODE][/QUOTE] Don't you also have to delete each [ICODE]p[/ICODE] array? :icon_wink: If you aren't sure, the answer is [I]yes[/I], delete each array first before deleting [ICODE]p[/ICODE] itself.

Member Avatar for Ancient Dragon
0
162
Member Avatar for DoEds

Enough, people. The facts are 1) fixed code should not have been posted by [I]anyone[/I] other than the OP 2) fixed code should not have been improved by anyone unless the OP posted correct code in the first place. 3) People who expect the world to [I]give[/I] them a free …

Member Avatar for Tom Gunn
0
359
Member Avatar for StaticShell

[QUOTE=StaticShell;903113] I never posted a problem in my life so I prob encased this code wrong too.[/quote] you did [I]much[/I] better than 95% of the new posters that can't be bothered to understand the forum before posting. :) [QUOTE=StaticShell;903113] 1) How can I make a new line within my "output" …

Member Avatar for StaticShell
0
157
Member Avatar for jessejamesjjr

You're welcome. Read the rules. Including the use of [B]u[/B] for [i]you[/i], [B]no[/B] for [I]know[/I], etc.

Member Avatar for jessejamesjjr
0
190
Member Avatar for Hiroshe

Your 1st half of the array [ICODE]array[x][0][/ICODE] is never initialized to zero so the values start out with garbage.

Member Avatar for Hiroshe
0
1K
Member Avatar for SP IT

[QUOTE=SP IT;902560]Here's what I have so far.[/QUOTE] And are you still having problems? Are we supposed to use our psychic powers or would you like to [I]explain fully[/I] what the problems are now?

Member Avatar for csurfer
0
120
Member Avatar for bahr_alhalak

[QUOTE=bahr_alhalak;899373]the problem that i need to use this program in another way for example : for looping , do-while looping[/QUOTE] So what's the problem? Doesn't your book describe a [ICODE]for[/ICODE] loop and a [ICODE]do-while[/ICODE] loop? You need to try it, we aren't supposed to do it for you.

Member Avatar for bahr_alhalak
0
225
Member Avatar for pmankow
Member Avatar for WaltP
0
106
Member Avatar for javaAddict

[QUOTE=cscgal;900271]Thanks for letting us know. I'm marking this thread solved since the offending user has been taken care of. :)[/QUOTE] [QUOTE=jbennet;900300]Cant banned users still send PMs?[/QUOTE] From the sounds of it, she had the user [I]taken care of![/I] Ouch! :ooh: :icon_mrgreen:

Member Avatar for The Dude
0
240
Member Avatar for krishnampkkm

You probably blew past your buffer and started writing to memory you should not have written to.

Member Avatar for Salem
0
250
Member Avatar for razor1234

[QUOTE=twomers;898519][inlinecode]unsigned int val = (unsigned int)array[0]; // For the value 1[/inlinecode][/QUOTE] If the OP wants the value 49, this will work. I think the OP might want the value 1 so subtract 48 from [ICODE]val[/ICODE] afterwards. But then again, he might mean something completely different. Please clarify [I]exactly[/I] what you …

Member Avatar for Ancient Dragon
0
232
Member Avatar for ankur shah

Binary files have binary information, not text information. Therefore, string functions probably will not be effective on the buffer. There are probably NULL characters in the binary data which will stop any string function from continuing past the character.

Member Avatar for tux4life
0
127
Member Avatar for srishekh

[QUOTE=Rashakil Fol;191160]You don't need finer resolution timing. If you want to measure the thickness of a piece of paper, would you buy an expensive microscope, or would you measure a stack of 200 pieces of paper and then divide by 200?[/QUOTE] In other words, run it a whole bunch of …

Member Avatar for WaltP
0
599
Member Avatar for lotrsimp12345

[QUOTE=lotrsimp12345;898195]nvm. going to ask teacher.[/QUOTE] Smart decision. At least your teacher knows what the program is supposed to do and can ask the questions needed to help you.

Member Avatar for WaltP
0
246
Member Avatar for XxGunMastaxX

[QUOTE=dsladev;898309]Here you go. Also as a side note, system ("pause") is a bad habit.[/QUOTE] So is: 1) posting code the OP should be writing 2) posting code that is not formatted Please do not post answers to questions. This forum is [I][B]not[/B][/I] a homework service. And that service should include …

Member Avatar for WaltP
0
152
Member Avatar for gretty

It looks like the parameter needs a [ICODE]char*[/ICODE] not a [ICODE]char[/ICODE]. IOW you need to pass the string, not the character.

Member Avatar for wildgoose
0
105
Member Avatar for imrankhalidtoor
Member Avatar for vb5prgrmr
0
2K
Member Avatar for MidiMagic

[QUOTE=MidiMagic;793547]The Firefox help site says it is probably an add-on some website installed without my permission.[/QUOTE] If this is true, what can [B]DaniWeb[/B] do about it?

Member Avatar for MidiMagic
0
173
Member Avatar for fghdmhmmd
Re: SLR

USE CODE TAGS!!! We see you didn't bother to read any of the requested information posted all over this site about CODE tags, like 1) in the Rules you were asked to read when you registered 2) in the text at the top of this forum 3) in the announcement …

Member Avatar for jephthah
0
221
Member Avatar for edenn1

[QUOTE=jephthah;893095]why do you need a helper function? seems that all the work is being done there anyhow.[/QUOTE] Because it's part of the assignment. The helper function is undoubtedly supposed to be recursive, checking a character at a time.

Member Avatar for WaltP
0
105
Member Avatar for slawted
Member Avatar for Lerner
0
218
Member Avatar for timb89

Change your comparison to [ICODE]if (word[i] < 57 && word[i] > 49)[/ICODE] Also, the line is better written as [ICODE]if (word[i] > 49 && word[i] < 57)[/ICODE] It's a more logical order for the comparison pair.

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

[QUOTE=blackrobe;893029]Hey there, I have a simple question: How can I read three characters by three characters from a string (character array) in C? Thanks for your help.[/QUOTE] You can't. A string is a single dimensional array and you need an array of arrays to read 3 by 3.

Member Avatar for s_sridhar
0
160
Member Avatar for sijithjp

[QUOTE=sijithjp;892784]plz help or give some advice... i tried a lot to do[/QUOTE] Not that we can see. Did you read the post titled "[I][B]Read Me: [/B]Read This Before Posting[/I]"

Member Avatar for WaltP
0
86
Member Avatar for athlon32

[QUOTE=athlon32;892903]thanks, that fixed the problem, the only thing i don't get is that i copied that from cprogramming.com and it didn't work, someone really should let them know lol anyways, THANKS![/QUOTE] well, [I]you[/I] copied the program and found the error. Maybe that someone sould be [B]athlon32[/B]. :icon_wink:

Member Avatar for WaltP
0
230
Member Avatar for vishalag

Even though you haven't told us all of your situation, I surmise the problem is when you come to a function from a library that you did not write. When you get to that function, Just execute it (don't step into it).

Member Avatar for vishalag
0
414

The End.