5,676 Posted Topics

Member Avatar for debasishgang7

[CODE]#include <stdio.h> #include <conio.h> main() { int i; char full; char array[10]="ABCD"; // Create the array with 4 letters followed by \0 for (i=0;i<=6;i++) // Loop 7 times full = array[i]; // copy the first 7 characters into FULL one // at a time printf("%c",full); // output the value of …

Member Avatar for abhimanipal
0
165
Member Avatar for ahalyakashyap

What part of:[quote=MemberRules] [B]Do use clear and relevant titles for new threads[/B] -- your title is worthless [B]Do provide evidence of having done some work yourself if posting questions from schoolwork assignments[/B] -- Nothing for us to help with[/quote] did you fail to understand? These are from the Member Rules …

Member Avatar for WaltP
0
102
Member Avatar for dmatos

We seem to have a 1:97 chance of guessing what line the error occurs on, which is difficult at best. The cool thing is if you supply enough details, we can certainly help.

Member Avatar for WaltP
0
428
Member Avatar for Chona Ramos

Are you kidding me with this post? 1) Title: [B]C++ Program[/B] -- Really? I never would have guessed! In a C++ Programming Forum I figured the post would be about making hamburgers. 2) Post itself -- and what are we supposed to do with this information? Write it? Give a …

Member Avatar for WaltP
0
166
Member Avatar for thecoolman5
Member Avatar for mike_2000_17
0
332
Member Avatar for jingda

[QUOTE=VernonDozier;]>> Do ensure that all posts contain relevant content and substance >> and are not simply vehicles for external links, including signature links Not necessarily an either/or. What about people who post stuff like you just posted ("thank you diz iz greeeeat post!") but who don't have an ulterior motive …

Member Avatar for TrustyTony
1
491
Member Avatar for angelsakura

[QUOTE=angelsakura;]if i wont use goto whats the alternative for that? how will i call mathematics in my program. so far when i simulate it without including the mathematics function, it allows the user to enter the first and second number, then my problem is the logic behind that. How? :([/QUOTE] …

Member Avatar for WaltP
0
2K
Member Avatar for Renzeeks
Member Avatar for mohanraj.m

[QUOTE=mohanraj.m;] after my task done it also returns some junk value like some different symbols how to avoid it?[/QUOTE] Don't know. We are unable to see your code as it is now, we don't know what your input was, we don't know what your output was.

Member Avatar for WaltP
0
155
Member Avatar for ari$av3s
Member Avatar for arindam31
0
168
Member Avatar for Joemeister

In [I]approachPI()[/I], make the sum [iCODE]static[/iCODE]. That will remember the last value from the previous call. You can [iCODE]static[/iCODE] any other values you need to remember. Be sure to set them to their initial values.

Member Avatar for Tellalca
0
185
Member Avatar for Dani
Member Avatar for dilequeno

Create your 1x6 array initialized to 0's Loop through the 2nd column and take the integer (nor rounded) value of the value as an index into the 1x6 array, and add the first column's value.

Member Avatar for TrustyTony
0
325
Member Avatar for clarence_cool03

You would. It's lame, rigid, and two years old. There are much better ways, and many have been posted in the past two years.

Member Avatar for arindam31
0
3K
Member Avatar for mhaber

[QUOTE=mhaber;]I realize it's a quite a lot of questions, but it's been a few days and I keep banging my head against the wall..[/QUOTE] Actually, there were no questions at all. Just a general description of your project. It helps to give us the details about [I]what[/I] you're banging your …

Member Avatar for mhaber
0
6K
Member Avatar for old_kid

[QUOTE=pseudorandom21;]Int to string is easy in C++ with a "stringstream", or if you prefer you can use an old C function. [code] int someInt = 256; string out; stringstream(someInt) >> out; [/code][/QUOTE] And how does [B]stringstream[/B] solve 1) recursion 2) comma-separated blocks? It helps to read carefully... :icon_rolleyes: Hey [B]Kid[/B], …

Member Avatar for m4ster_r0shi
0
144
Member Avatar for imraannaimullah
Member Avatar for WaltP
-1
161
Member Avatar for byrosport

Major Fail! 1) No CODE Tags so the code is unreadable 2) No explanation of what the code is supposed to do 3) No explanation of what you're having trouble with

Member Avatar for WaltP
0
199
Member Avatar for syria718

[QUOTE=mtatadotcom;]the problem is in this portion of the code [CODE] scanf("%c",&choice1);[/CODE] try puting a space betewee " and %C when declaring the variable type char, this sometimes refuses to accept the input and porceeds to the end or enters a random input instead try replacing that piece of code with …

Member Avatar for Narue
0
277
Member Avatar for syria718

What problem? We didn't write the code so we don't know if it's right or wrong either. It might help to tell us what you're having problems with. We aren't psychic -- we're programmers.

Member Avatar for syria718
0
121
Member Avatar for Riaz Haider

[QUOTE=Riaz Haider;]does that work....i'm having problems in the simulation...the first else if doesnt work in the correct range that Yellaiah told me....[/QUOTE] Then you did it wrong. Without seeing the code, we can't offer suggestions.

Member Avatar for Riaz Haider
0
316
Member Avatar for PDB1982

The best language is the language that has: 1) File Input 2) Console Input 3) Console Output 4) IF statements

Member Avatar for WaltP
0
252
Member Avatar for milan2011
Member Avatar for Lyandor
0
170
Member Avatar for mtatadotcom

[QUOTE=griswolf;]The usual way of computing min and max goes like this, in pseudocode: [CODE]cur_min = a-number-at-least-as-big-as-the-data-minimum // INT_MAX works cur_max = a-number-at-least-as-small-as-the-data-maximum // INT_MIN works [/code][/QUOTE] I would start out slightly differently: [CODE] cur_min = first-number-in-the-array cur_max = first-number-in-the-array [/code] This way you don't have to guess at a hopefully …

Member Avatar for mtatadotcom
0
167
Member Avatar for PinoyDev
Member Avatar for DarkPyros

[QUOTE=DarkPyros;]i wrote a program to take text from a file of my choice named "data" and print it out on the screen, how can i tweak this so taht when the text comes out , it would be all in upper case using toupper??[/quote] 1) what does [I]toupper()[/I] do? 2) …

Member Avatar for DarkPyros
0
184
Member Avatar for syria718

I don't understand your logic here: [CODE] printf("Do you want to enter another contact?Y/N\n");/*condition question of loop*/ scanf("%c",&choice2); if (choice2 == 'y' || 'Y'){ choice2 == 'y'; }else{ break; } }while(choice2 == 'Y' || choice2 == 'y'); [/CODE] [ICODE]Accept [I]choice2[/I][/ICODE] [ICODE]If [I]choice2[/I] is eith 'y' or 'Y', change it to …

Member Avatar for syria718
0
160
Member Avatar for Dean_Grobler

[QUOTE=jwenting;]As to human evolution, it's impossible to predict and there are many contradictory ideas. I myself believe it's either stagnant or reversing,...[/quote] So we're becoming apes again? In some cases that's certainly looks true :icon_razz: [QUOTE=jwenting;]... as there's no longer any competition based on genetics going on to select the …

Member Avatar for guest star
0
190
Member Avatar for Riteman

Define [I]alignment[/I]. I for one have no idea what you're talking about.

Member Avatar for thecoolman5
0
176
Member Avatar for DarkPyros

Then, after you do what [B]Adak[/B] suggested, on a piece of paper draw 2 empty matrices labeled [B]arr[/B] and [B]barr[/B]. Label the left sides and tops based on the indices used in the program posted. Now follow the program line by line, recording values of all the variables.

Member Avatar for DarkPyros
0
168
Member Avatar for west456

[QUOTE=west456;]Need help on this not for sure what I am missing I get a couple of errors!In included both the .h and .cpp information.[/quote] A couple of errors? Must be something wrong then. But since we aren't psychic, you might want to be less vague.

Member Avatar for Lyandor
0
551
Member Avatar for WaltP

I ran across [url=http://wpattinson.com/what.mp3]this song[/url] and would like to know who it is, what it is, and what language is it? It sounds German-like but not quite. Is it about football? (that's soccer for you NorteAmerican folks :icon_wink:) Thanks.

Member Avatar for FallonCurly
0
135
Member Avatar for radiata

[QUOTE=StuXYZ;]Sorry, but regardless of the errors in your code you have the wrong algorithm. [/quote] As do you. [QUOTE=StuXYZ;]You seem to have assumed that you can translate directly from base 10 decimal numbers, you cant. Eg. Consider 49. That would be written IL. however, your code would produce XL1X. [/quote] …

Member Avatar for WaltP
0
178
Member Avatar for luisFilipe

[QUOTE=luisFilipe;]First let me tell you what my program is doing. its basically a shopping list program. Whereby the user will input the values and it is then inserted into a text file. There will be 3 inputs (Item Description,Unit Price,Quantity Purchased) and is stored into the text file as (Shoes:$200:2)...[/QUOTE] …

Member Avatar for caut_baia
0
95
Member Avatar for yazooney

No, what he said is the headers have no code associated with them. Headers don't [I]do[/I] anything. It's the [I]libraries[/I] (code) that are associated with the headers that process the functions. Without them, the header is useless.

Member Avatar for chevuru.anil
0
2K
Member Avatar for jejak
Member Avatar for Adak
0
665
Member Avatar for clickspiker23

A suggestion if I may... Create a function that takes 1) Package 2) Usage and returns Cost Then you can call the function at the top and display the usage cost. For part 2, call the function twice more with the other two Package values and you can subtract the …

Member Avatar for WaltP
0
106
Member Avatar for byrosport

My psychic powers aren't working. I have no idea what you tried any of the three times so have no suggestions other than think through the problem on paper and don't try to code [I]anything[/I] until you understand the problem.

Member Avatar for WaltP
0
291
Member Avatar for alex1050

[QUOTE=N1GHTS;]On that kind of IDE, your better off using spaces exclusively or tabs exclusively.[/QUOTE] Actually [I]you're[/I] (note the spelling) better off using SPACEs. They are always consistent. TABs are not

Member Avatar for alex1050
0
107
Member Avatar for confused_one

No wonder you're confused. [QUOTE=confused_one;] I am using Dev-C++ and when I am trying to compile a program in it, it is showing many errors. All the settings seems to be right. Can I compile a program including header files like conio.h and iostream.h and using namespace std in Dev-C++? …

Member Avatar for Stefano Mtangoo
1
4K
Member Avatar for jashbela

Read up on the semi-colon. You have no idea yet how/when/where to use them. Your book is the best place to learn this simple stuff.

Member Avatar for jashbela
0
336
Member Avatar for sagar d

[QUOTE=sagar d;1597868]@imkj:the code is the same thats above... both the links(4shared & c.happycodings.com) have got errors(sadly,too many)...[/QUOTE] Then you should happily contact the author and ask [I]them [/I]to rewrite it for you.

Member Avatar for imkj
-1
233
Member Avatar for bhallarahul
Member Avatar for ana_1234

[code] do { in1.open(argv[1], ios::binary); if (!in1) cout << "That is not a valid file. Try again!\n"; } while (!in1); [/code] interesting loop. Try to open the file named in [I]argv[1][/I]. If it doesn't open, try to open the file named in [I]argv[1][/I]. If it doesn't open, try to open …

Member Avatar for WaltP
0
354
Member Avatar for vergil1983

Set up another variable ([I]power[/I]) set to 1 Use a loop. As you go thru the loop 1) Mult [I]power[/I] by [I]num1[/I] -- n^i 2) Divide by loop index 3) Add/Subtract that value from a [I]total[/I]

Member Avatar for deliezer
0
3K
Member Avatar for DarkPyros

Even though [B]AD[/B] explained the problem, I have to add to it: [QUOTE=DarkPyros;]hey, this is supposed to collect data into a 2 by 3 array. believe it or not, my teacher wrote this problem and he spent 20 minutes trying to figure out why it wasn't running properly. anyone care …

Member Avatar for Aia
0
155
Member Avatar for WaltP

For years when people post that they are using Turbo-C/C++ they always get a heated response saying basically "[I]why are you using that piece of sh*t? Use Dev-C++ instead.[/I]" Dev-C++ was being recommended because it's newer, it followed the standard better, it's free, etc. A couple years ago, though, it …

Member Avatar for pseudorandom21
0
1K
Member Avatar for treger69
Member Avatar for jemz

Use a combo box. That has a dropdown already whereas a textbox does not. Don't you ever get tired of typing "[I]Thank you in advance and i am hoping for your positive response... "[/I]? It's really getting old -- over a year and a half old... And unnecessary. :icon_rolleyes:

Member Avatar for WaltP
0
255
Member Avatar for NathanOliver

The End.