Posts
 
Reputation
Joined
Last Seen
Ranked #258
Strength to Increase Rep
+9
Strength to Decrease Rep
-2
85% Quality Score
Upvotes Received
17
Posts with Upvotes
16
Upvoting Members
15
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
14 Commented Posts
~41.3K People Reached
About Me

I'm a student, freshly passed out of school, and waiting for college to begin, and very, very interested in programming, 'specially in C++. I also love the realm of Web Development, and enjoy animation (in-fact, I'm now taking a course on it) :D

PC Specs
System: Linux, Ubuntu 10.04 LTS Lucid Lynx Computer: Intel(R) Pentium(R) 4 CPU 2.66 GHz 1024 MB RAM…
Member Avatar for BobRoss

[CODE=cplusplus] #include <cstdlib> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]){ string line = ""; int lineLength = 0; int shiftValue = 0; int asciiValue[lineLength]; // <- Problem1 char cipherLine[lineLength]; // <- Problem 2 ifstream plainText ("plain.txt"); ofstream cipherText ("cipher.txt"); cout << "Please enter a shift …

Member Avatar for happygeek
0
1K
Member Avatar for sillyboy

And I'm listenin to: [ICODE]Another Day In Paradise by Phil Collins[/ICODE]

Member Avatar for Helianthus
0
5K
Member Avatar for FraidaL

A quick glance at the definition of the overloaded `istream` and it's clear that you've missed the fact that dividing two integers will lead to a loss of precision. Change `int b;` to `float b;` and you're good to go (provided `class fraction` stores a fraction as a floating-point value, …

Member Avatar for FraidaL
0
134
Member Avatar for kbrook

hi, Could you tell us what the message is in the "send error report to Microsoft" dialog?

Member Avatar for stultuske
0
238
Member Avatar for lss123

I tried the same code on the same IDE (same version as well), with the same compiler, running under Windows XP, and it executed perfectly. Check the integrity of your copy of GCC, and if it isn't, try installing it again.

Member Avatar for JamesPhillips
0
673
Member Avatar for ^Y^ nobody ^Y^

To output just a certain part of a string, you'll need to use [ICODE]std::string[/ICODE]'s [ICODE]substr(size_t pos, size_t n)[/ICODE], which essentially extracts a part of the whole string, as specified by its parameters, where [ICODE]pos[/ICODE] is the starting index and [ICODE]n[/ICODE] represents the number of characters to extract after [ICODE]pos[/ICODE]. An …

Member Avatar for amrith92
0
142
Member Avatar for Duki

Pointers aren't required, simply change the prototype & definition of the function [ICODE]get_tp()[/ICODE] to something like: [CODE] int& get_tp() { return myint; } [/CODE] However, If you want to maintain const-correctness (and I think that that's usually a good idea), then you don't have to change the function at all, …

Member Avatar for Duki
0
176
Member Avatar for aikiart

To answer your question: If you have overloaded the said operators in your class definition, then yes, they will be called automatically. For the second part of your question: In C++, it can be generally assumed that all such statements follow operator precedence. As both binary addition ([ICODE]+[/ICODE]) and subtraction …

Member Avatar for aikiart
0
211
Member Avatar for smcguffee

If the code below illustrates your question, then yes, it is possible, even necessary for us to call the constructor in the initializer-lists from the subclass. [CODE=cplusplus] class Base { public: Base(std::string text, int blah) : mText(text), mBlah(blah) { /* ... */ } // Some other methods private: std::string mText; …

Member Avatar for smcguffee
0
113
Member Avatar for blaisemcrowly

Using [ICODE]gets()[/ICODE] is usually a bad idea from the start (See [URL="http://www.gidnetwork.com/b-56.html"]this[/URL] page for more information), but this problem is usually caused by stray characters still present in the buffer. [ICODE]gets()[/ICODE] will simply take those characters as input and it seems as though your program is skipping input. It can …

Member Avatar for blaisemcrowly
0
234
Member Avatar for Bigbrain99

Well, I can't say much just by looking at your (incomplete)code, but I wonder exactly how you are [I]passing[/I] the vector to [ICODE]main()[/ICODE] or any other function, as [ICODE]vector<string> myvector;[/ICODE] remains a [B]local[/B] variable, and looking at your definition of the function [ICODE]LoadFile()[/ICODE], it doesn't return anything. To answer your …

Member Avatar for amrith92
0
104
Member Avatar for achieve_goals

Try this: [ICODE]temp->link(num_people, head);[/ICODE]. You've declared the variable [ICODE]temp[/ICODE] to be a pointer, but you are accessing its member function as though it were a normal object and not a pointer object. See [URL="http://msdn.microsoft.com/en-us/library/b930c881%28VS.71%29.aspx"]this[/URL] for more info.

Member Avatar for achieve_goals
0
112
Member Avatar for leesho

I think you're looking to dynamically implementing your arrays. See [URL="http://www.cplusplus.com/doc/tutorial/dynamic/"]this[/URL] for more information. There's also a few points about your code: [B]1.[/B] Your bubble-sort can be improved with a flag to reduce the number of iterations required to sort it. See [URL="http://www.mathbits.org/MathBits/CompSci/Arrays/Bubble.htm"]this[/URL] for an example. [B]2.[/B] Your code could …

Member Avatar for mrnutty
0
268
Member Avatar for erka4444

This should help: [URL="http://www.daniweb.com/code/snippet217375.html"]Code Snippet[/URL] Also, the function [ICODE]itoa()[/ICODE] is not defined in the ANSI-C++ standard, so it may not be supported on all platforms. Hope this helped

Member Avatar for amrith92
0
96
Member Avatar for umandajayo

To answer your questions: [B]1.[/B] Just do it. Start programming. I'm sure it wouldn't be that huge a leap for you coming from a PHP/Java background. Start with the humble "[B]Hello World[/B]" program, and head out from there... [B]2.[/B] A quick search on [B][I]google[/I][/B] or [B][I]sourceforge[/I][/B] will provide you with …

Member Avatar for mohsho
0
101
Member Avatar for pineapple23

A good first attempt :) From your code, I can suggest some improvements: 1. [B][COLOR="Red"]NEVER[/COLOR][/B] use [ICODE]system("pause");[/ICODE]. See [URL="http://www.gidnetwork.com/b-61.html"]here[/URL] for more information. Use [ICODE]std::cin.get();[/ICODE] instead. 2. To make typing the code shorter, you should always look to reduce repetitive code, like the following statements: [ICODE]cout << "Enter two Real numbers." …

Member Avatar for amrith92
0
367
Member Avatar for i_luv_c++

Do you have some code to show for what you say you've done? I'm sure you know by now that we here at Daniweb do [B]NOT[/B] provide help without the OP showing some sort of effort. If you post your code, maybe we can point you in the right direction …

Member Avatar for Swiftle
0
79
Member Avatar for dualdigger

This is usually caused by your application's manifest file, which might refer to a wrong version of the redistributable VC90.CRT/MFC/ATL dll package, or these packages may not be installed on the traget machine. If you haven't embedded your application's manifest file, then you can see a line in the manifest …

Member Avatar for amrith92
1
493
Member Avatar for tendavola

HmmMMMmmm... IMHO, I think this can be done in a simpler way, by using two loops instead of one, that iterates over the entire range of your 2D array. If you have worked with matrices in C++, then you'll know what I'm talking about. Now in C++, array indices start …

Member Avatar for NP-complete
0
103
Member Avatar for Jack_1

First of all, I think that there's a simpler way to achieve what you are trying to do here. The algorithm for finding factors of any given number goes something like this: (In pseudo-code) [CODE=cplusplus] maximumDivisor = squareroot of number; // The maximum possible divisor for(x = 1 till x …

Member Avatar for NP-complete
-1
150
Member Avatar for timb89

If your file structure is consistent to the sample you provided, you could also try: (In pseudo-code) [CODE=cplusplus] { // Inside your file-reading loop Matrix[num][num] = floatnum; // where num = line number } [/CODE] Or you could use a class to represent your matrix, as daviddoria suggested, which would …

Member Avatar for mrnutty
0
303
Member Avatar for younas khan

@Patces: Please refrain from hijacking threads. If you have a question you can't find a solution to, please start your own thread. Also, we can only help you if, and only if, you have put in some sort of effort in, i.e show us some of the code you've been …

Member Avatar for amrith92
0
116
Member Avatar for Alainztol

Hi, Well you're right, there seems to be no point in the message. Check the browser you are viewing the page with. Also it could be that your web server is blocking it.

Member Avatar for prasad.gopale
0
122
Member Avatar for squigworm

More specifically, this is your problem (the one in bold): [ICODE]bookinfo([B][COLOR="Red"]int&[/COLOR][/B], char [51], char [14], char [31], char [31], char [11], int&, double&, double&)[/ICODE] Try changing it to just [ICODE][B]int[/B][/ICODE], as [ICODE]int&[/ICODE] is almost equivalent to [ICODE]int*[/ICODE], which is not the type of the first argument in your function prototype.

Member Avatar for lotrsimp12345
0
152
Member Avatar for merse

[B]>>[/B] Why it is necessary? Well, it shouldn't be... I tried the code separately on both GCC and minGW compilers, and both compiled well and didn't complain... Try adding the statement [CODE=cplusplus]using std::ostream;[/CODE] and try again...

Member Avatar for merse
0
99
Member Avatar for bgavran3

[B]>>[/B] Now, if after reading the code the output isn't strange to you then my understanding of C++ is probably very wrong and I'm missing something obvious. Well, as you've rightly guessed, the output is as expected... :) You may now be wondering why this happens - well, when you …

Member Avatar for amrith92
0
126
Member Avatar for Bladtman242

Why not try this: [code=c++] #include <iostream> #include <fstream> using namespace std; int main() { ifstream iptilvar; iptilvar.open ("ip.txt"); //open filestram iptilvar.seekg(0, ios::end); long size = iptilvar.tellg(); // Get the size of the file iptilvar.seekg(0, ios::beg); char *buffer = new char[size]; // Make a buffer big enough to hold the …

Member Avatar for Bladtman242
0
621
Member Avatar for merse

I'm not sure, but try: [CODE=cplusplus]real x = {1.};[/CODE] With this, you wouldn't need to overload any operator... Hope it helped!

Member Avatar for amrith92
0
131
Member Avatar for dapage

[QUOTE=jonsca;1061542]Your main should never return void, [I]always[/I] an int. You should have return 0; at the end. Using another return statement in the midst of your [code] if (w==1) cout<<"You win!"; else if (w==2) cout<<"You lose!"; else if (t==9&&w==0) cout<<"Tie Game"; [/code] might be a good idea. I haven't familiarized …

Member Avatar for jonsca
0
146
Member Avatar for confusedndazed

Okay, before I answer your question, a few things need to be cleared. In all the code I've seen till now, [ICODE]<ionstream>[/ICODE] is by far the most striking alternative to the known, and beloved [ICODE]<iostream>[/ICODE] (although, I must admit, [B]ion[/B]stream sounds cool). And another thing is the [ICODE]cin[/ICODE] statement at …

Member Avatar for amrith92
0
145