Posts
 
Reputation
Joined
Last Seen
Ranked #782
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
5
Posts with Upvotes
5
Upvoting Members
5
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
5 Commented Posts
~22.4K People Reached
Favorite Forums
Favorite Tags
c++ x 90
Member Avatar for Tommybb

[QUOTE=Tommybb;759674] .... Are there any good online sources you all would recommend for a beginner? Thannks, Tom [/QUOTE] The following site is good, but of course won't cover much. I personally learn only from the internet, and make programs for fun and complex calculations. Whenever I want to do something …

Member Avatar for parul26sha
0
1K
Member Avatar for thilinam

Binary operations are operations between two variables (like a+b, a-b, a^b, a/b etc.). Unary operations are operations on one variable (a++, a-- ...)

Member Avatar for pirbhat.ariya
0
235
Member Avatar for clutchkiller

Look at this link: [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385[/url] The last method is probably what you're looking for.

Member Avatar for Narue
0
2K
Member Avatar for jiten_raulo

In case you like math, you can try the following site: [url]http://projecteuler.net[/url]

Member Avatar for jiten_raulo
0
139
Member Avatar for esesili

Two things: First, you forgot to add the first number to the total. Second, with [icode]while(!source_file.eof())[/icode] you run through the last line twice. Therefore, instead of 10+20+40+10+12 = 92 you get 20+40+10+12+12 = 94

Member Avatar for mrnutty
0
128
Member Avatar for kelechi96

Look at the code here: [code] if (pos [color="red"]![/color]= -1) { goto badsearch; } [/code] I think you meant: [code] if (pos [color="red"]=[/color]= -1) { goto badsearch; } [/code] Another thing is that string::search() returns string::npos if the search function does not find what it was told to find, and …

Member Avatar for kelechi96
0
167
Member Avatar for FREEZX

I don't understand - why do you have the numbers input as 'int'? Why don't you have the numbers input directly into a string and then use the operator [] to move through the digits and count values? I think it could be much more efficient - just run a …

Member Avatar for tux4life
0
1K
Member Avatar for archiphile

In addition to the above posts: 1) The user has no chance to input the second number. Better add [icode]cin>>dsecondnumber;[/icode] after the user is told to input the second number. 2) In your [icode]case[/icode] statements the output is always [code]cout<< " The Answer is:"<< dfirstnumber << (operator) << dsecondnumber << …

Member Avatar for RayvenHawk
0
173
Member Avatar for soulbee1

Why not use the built-in [URL="http://cplusplus.com/reference/algorithm/random_shuffle/"]random shuffle()[/URL] function from the header [icode]<algorithm>[/icode]?

Member Avatar for nucleon
0
728
Member Avatar for wuzj1988

Look at your while loop: you closed it before it started: [icode]while(ordnum != 99999);[/icode]. Just remove the semicolon right after the [icode]while(ordnum != 99999)[/icode] and everything should be fine ;)

Member Avatar for wuzj1988
0
142
Member Avatar for SmokyMo

Change this line: [icode]cout<<fly.freeSeat;[/icode] to this: [icode]cout<<fly.freeSeat[color="red"]()[/color];[/icode] Remember that [icode]freeSeat[/icode] is a function ;). Edit: I guess Narue was faster :)

Member Avatar for SmokyMo
0
131
Member Avatar for badboizEnt

Add [icode]Password="";[/icode] before [code=c++] while(encrypt != 13) { Password.push_back(encrypt); cout << '*'; encrypt = _getch(); } [/code] That's because when the user enters a wrong password you keep [icode]Password[/icode] with the wrong password and just add characters to it. You need to empty it before.

Member Avatar for badboizEnt
0
160
Member Avatar for Clockowl
Member Avatar for rudolph2004

What about a linked list? Or alternatively, you could store all the class instances in an array with as many elements as the the user inputs, and to check which instance has the student's ID run a loop through all the indexes. An example to make it all clearer: [code=c++] …

Member Avatar for unbeatable0
0
129
Member Avatar for queensrose

The function is expecting an int[] (array/pointer) type and you pass an int, instead you should write the function as: [icode]void bookInfo(char[14],char[51],char[31],char[31],char[11],int,double,double);[/icode] It would also be better if you used strings from the <string> header instead of arrays of [icode]char[/icode]s.

Member Avatar for unbeatable0
0
137
Member Avatar for iammfa

[QUOTE=iammfa;844199]Hi all, what is the bug in the following code: [code=c++] #include <iostream> #include <string> int main() { string str = "Hello World!" cout << str << endl; cout << float x = 5.0f * str << endl; int 65Num = 65; cout << "65Num = " << 65Num << …

Member Avatar for stephen.id
0
138
Member Avatar for hurbano

[code=c++]outputFile<<"Name: "<<Pname<<" "<<outputFile<<"Date:"<<TDate<<endl;[/code] You output what outputFile returns. This line should be [code=c++]outputFile<<"Name: "<<Pname<<" "<<"Date:"<<TDate<<endl;[/code]

Member Avatar for hurbano
0
166
Member Avatar for hurbano

I'm guessing it's because of the getline() function. When I replace the [code=c++] if(AWUTD=='y'||AWUTD=='Y') { cout<<"Please Specify:"<<endl; getline (cin, AWUTDspecification); } [/code] with [code=c++] if(AWUTD=='y'||AWUTD=='Y') { cout<<"Please Specify:"<<endl; cin>>AWUTDspecification; } [/code] it works better. I suggest that you read the following ReadMe thread: [URL="http://www.daniweb.com/forums/thread90228.html"] How do I flush the input …

Member Avatar for tux4life
0
265
Member Avatar for arunciblesp00n

[QUOTE=vmanes;761217]Where do you get an 8 byte long int? It's 4 bytes everywhere I've seen.[/QUOTE] A [icode]long long int[/icode] (signed/unsigned) is 8 bytes. [icode]cout<<sizeof(long long)[/icode]

Member Avatar for ArkM
0
5K
Member Avatar for ademsaykin

Please use code tags. Otherwise it'll be hard for us to tell you on which lines your mistakes are.

Member Avatar for ademsaykin
0
295
Member Avatar for Icebone1000

You'll have to re-write everything. Just make a new file, read the file you want, and write the lines to the new file, with the changes you want. Afterwards, erase the old file and rename the new file to the old file's name. There's something similar (erasing a line from …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for Cpp_Addict

What do you mean? Do you want the blocks to appear in lines, like that?: [code] ****** ****** ****** ****** ****** * * * * * * * * * * * * * * * * * * * * ****** ****** ****** ****** ****** [/code] If you do, …

Member Avatar for unbeatable0
0
119
Member Avatar for Agni

It doesn't matter that 'i' doesn't exist when main() ends and the thread is using it, simply because when main() ends the whole program shuts down, including the threads.

Member Avatar for Salem
0
189
Member Avatar for new2c++
Re: game

The computer doesn't recognize when a cell is occupied because you didn't tell it to. You're making a check only on board[5][x]. You should use a loop to check which is the the highest place available and just then test it.

Member Avatar for MosaicFuneral
0
100
Member Avatar for tomtetlaw

A much clearer method would be [icode]rand()%x[/icode], where x is the number you want. For example, [icode]rand()%7[/icode] will return a random number between 0 and 6, and the code [icode]rand()%7+1[/icode] will return a value between 1 and 7. If you want the numbers to be as random as possible, add …

Member Avatar for Narue
0
296
Member Avatar for Shinedevil

[url]http://www.daniweb.com/forums/post31214.html[/url] This link should help you. It teached me well how to use ifstream objects.

Member Avatar for daviddoria
0
137
Member Avatar for dextrew

We won't do your homework. You should provide us some code so we can know you've at least tried. [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for William Hemsworth
0
192
Member Avatar for rkumaram

Why should a constructor fail? When you declare a constructor, all the instances of the class will have to use it, or variations of it (if you declare some).

Member Avatar for rkumaram
0
168
Member Avatar for ninja_gs

[code=c++] for(x=0;x<s.length();x++) { if((s[x]>'9' || s[x]<'0') && s[x]!='.') { input_type=IS_STRING; break; cout<<" Its an integer "; } else if(s[x]=='.') { if(!DotReached) DotReached= true; else { input_type=IS_STRING; cout<<"ITs a Float"; break; } } } [/code] Line 6: How do you want the program to output "It's an integer" when there's a …

Member Avatar for ninja_gs
0
118
Member Avatar for 30Caliber

I think it would be much smarter to use the built-in function from <algorithm> header file -- random_shuffle(): Run a loop and insert to the array all the numbers between 1 and 10,000, then call random_shuffle() to shuffle them. An example code: [code=c++] #include<iostream> #include<fstream> #include<algorithm> using namespace std; int …

Member Avatar for 30Caliber
1
2K