244 Posted Topics

Member Avatar for Srinivas0
Member Avatar for zck17
Member Avatar for mikrosfoititis
0
183
Member Avatar for zck17

for the first question google SRAND line 42 you create an array of ints then on line 45 you attempt to read a value to this array without specifying which location in the array you want to store it. I think you want to take in the digits of the …

Member Avatar for frogboy77
0
228
Member Avatar for TaoNinja

Why do you have 2 loops when you just add to sum after line 16. This can be easily done without the need for arrays.

Member Avatar for frogboy77
0
448
Member Avatar for pato wlmc
Member Avatar for mc3330418

The only reason i have came across for a function with nothing sent to it and no return is output to the console. Google [B]cout[/B].

Member Avatar for WaltP
0
144
Member Avatar for serenaL
Member Avatar for rohan121212
Member Avatar for Muhammad Anas
Member Avatar for Kyle Willett

[CODE]#include <iostream> #include <string> using namespace std; bool is_pal(string a) { int b=a.length(); for(int i=0;i<(b/2);++i) if(a[i]!=a[b-i-1])return false; return true; } int main() { string s; cout<<"Please enter a string:\n"; cin>>s; if(is_pal(s)) cout<<"This is a palindrome.\n"; else cout<<"This is not a palindrome.\n"; return 0; }[/CODE]

Member Avatar for frogboy77
0
267
Member Avatar for amgad habeeb
Member Avatar for PrimePackster

Why the { on line 27? What if n%10=1? i.e n=11 or 21? EDIT Beat me to that Nick:) I have also been led to believe goto is BAD. A while or do while loop may be better.

Member Avatar for Fbody
0
357
Member Avatar for armaan ali

I think this is what you need. [URL="http://www.daniweb.com/software-development/cpp/threads/78223"]here[/URL]

Member Avatar for frogboy77
0
310
Member Avatar for Aghtar
Member Avatar for spar
Member Avatar for seraphina
Member Avatar for phorce

I think he is referring to [URL="http://en.wikipedia.org/wiki/Letter_frequency"]this[/URL].

Member Avatar for frogboy77
0
155
Member Avatar for pseudorandom21

[QUOTE]If you're like me and enjoy Steam's service (not having to mess with DVDs and CDs),[/QUOTE] [URL="http://www.bbc.co.uk/news/technology-15690187"]http://www.bbc.co.uk/news/technology-15690187[/URL]

Member Avatar for frogboy77
0
183
Member Avatar for skylinedrifter
Member Avatar for GrimJack

Well it is difficult to kill 127 of one's schoolmates without one. DUH.

Member Avatar for pseudorandom21
0
468
Member Avatar for cwarn23
Member Avatar for Ancient Dragon
Member Avatar for TheFearful
Member Avatar for raptr_dflo
0
337
Member Avatar for myrongainz

1 Where are your #includes and namespace? 2 What is str.length (why would that give you the size of k)? 3 Where is your output line? EDIT If this is a snippet ignore 1, if not you need to check your braces and there is no return statement.

Member Avatar for myrongainz
0
620
Member Avatar for New4lyfe

[QUOTE]I a still confused, maybe I am looking too much into it, but I am so lost. Please someone help me.[/QUOTE] No what you mean to say is "Please someone do it for me." Much more precise. (see i have already helped)

Member Avatar for New4lyfe
0
188
Member Avatar for crane476

It is repeating the loop. Try a couple of cout lines to find out where you're going wrong(ie right before line 21).

Member Avatar for crane476
0
111
Member Avatar for JuloF26
Member Avatar for sergent
Member Avatar for AliTheChamp
0
330
Member Avatar for Max Hydes

I doubt she's going to do everything for you. Unless she's in a really really really good mood.

Member Avatar for Max Hydes
0
896
Member Avatar for dragon_chick

you could try [CODE]srand(time(NULL));[/CODE] worked in the past for me but hey i'm not good at this so "pinch of salt".

Member Avatar for dragon_chick
0
415
Member Avatar for Info_stealth13
Member Avatar for zendet
Member Avatar for frogboy77

English rioting for no apparent political reason, more a case of get what you can while the going is good. Does it get much worse than [URL="http://www.bbc.co.uk/news/magazine-14487982"]this[/URL]? Is society really broken?

Member Avatar for pseudorandom21
0
426
Member Avatar for c++creator

I didn't realise there was an age limit. Could you let me know what it is. I'm 3 years old by the way.

Member Avatar for frogboy77
0
567
Member Avatar for Onlineshade

[QUOTE]I don't do graphics. My expertise is in back-end development.[/QUOTE] [URL="http://www.transforminglives.co.uk/buttock-implants.html?incoming=googlead&gclid=CLLYiMzrgasCFeYmtAodpFf70g"]Like this?[/URL]

Member Avatar for m4ster_r0shi
0
165
Member Avatar for happygeek

[QUOTE]42% of Brits have not sent a snail mail letter in the last six month[/QUOTE] that would have been true for me before email [QUOTE]51% of British workers would rather send an email than pick up the phone to a colleague, whereas only 24% would do the rather do the …

Member Avatar for GrimJack
1
4K
Member Avatar for Martin C++

you are replacing tmp every time you compare 2 values. ie on the very last check if person[9]>person[8](or nine in this case, checking against itself) you replace the value. this doesn't mean it was the biggest of all. one loop should be sufficient for this task.

Member Avatar for frogboy77
0
212
Member Avatar for Tommy Mayor

I doubt anyone will help you without some sign you have attempted the problem yourself. Even if someone were so charitable (i.e stupid) your description of the problem is a little vague. Go away make an effort and come back with a specific problem.

Member Avatar for frogboy77
0
59
Member Avatar for iamthwee
Member Avatar for frogboy77

At what point does conciseness become more important than readability, or vice-versa (given that there is no difference in performance)? Is there an element of snobbery amongst programmers to certain techniques or are certain things just purely bad practice?

Member Avatar for BitBlt
0
91
Member Avatar for thecoolman5

In line 23 if I enter 100+99 why would the second character in the string be an operator? Line 25 in the second i believe chars are compared with '' not "" edit: that's single not double quotes (though i think this project may be flawed at the planning stage)

Member Avatar for thecoolman5
0
579
Member Avatar for MareoRaft
Member Avatar for programing

[QUOTE]No doubt, the easiest language to write a compiler for is Brainf*ck. Writing an interpreter for this language is probably gonna require less lines of code that the "Hello World" program in Brainf*ck.[/QUOTE] That's pretty strange. Then again so is [URL="http://en.wikipedia.org/wiki/Fractran"]this[/URL].

Member Avatar for rubberman
0
245
Member Avatar for mrnutty

I think i prefer atheism on the basis that spending eternity in hell sounds pretty bad but spending eternity in a place with all the "good" people sound like the christmas day with the family ad infinitum.:scared:

Member Avatar for iamthwee
2
1K
Member Avatar for Portgas D. Ace

I would consider making 2201 posts in 2 months an obsession or something more malicious. (i.e spammer or very lonely person)

Member Avatar for Capt. Fantastic
0
208
Member Avatar for frogboy77

I wrote this test code trying to work out a problem. The code gives the correct answer for the example (zero) but to understand the problem i need to understand what the code is doing on a sort of step by step basis. In other words how to do it …

Member Avatar for frogboy77
0
116
Member Avatar for WASDted

The problem is the poor(including myself) don't have the will and drive of the rich, otherwise we'd have taken all they've got by now.

Member Avatar for Agilemind
3
549
Member Avatar for Ancient Dragon

I watched every second. I am never prouder than the occasions where i partly finance an event for people i don't know or will probably ever meet. Proud to be British.

Member Avatar for Lardmeister
0
176
Member Avatar for Nick Evan
Member Avatar for jingda
1
227
Member Avatar for WASDted
Member Avatar for jingda
1
410

The End.