- Upvotes Received
- 21
- Posts with Upvotes
- 19
- Upvoting Members
- 18
- Downvotes Received
- 24
- Posts with Downvotes
- 18
- Downvoting Members
- 15
- Interests
- Video games, coding, football,adventures
- PC Specs
- Windows 7 (x86)
195 Posted Topics
Re: If I were you, I'd avoid using char arrays ... what happened to string? [CODE] //Employee.h // // #include<iostream> #include<string> using namespace std; class Employee { private: string name,lastname; // String of name and last name; int salary; public: Employee() // Constructor to initialize default values. { salary=0; name=""; lastname=""; … | |
Re: Nice,long code..cool ideas...not so good organisation...doesn't compile on nearly all compilers apart 4rm dev-c++(i tried to compile it on borland c++.8 errors). all in all, good code | |
Hi,everyone.. I was wondering.. Is it possible to carry out other tasks in a php application while data is being uploaded(by that application) into a MySQL database? | |
Re: [CODE] 14.cout << "Please enter the values:\n"; 15.cin >> nums[size]; [/CODE] The above lines would only accept 1 value....nums[size]. Use a loop instead: [CODE] for(int i=0;i<size;i++){ cin>>nums[i]; } [/CODE] | |
Re: you could use cstdlib's [B]system()[/B], then call DOS function rmdir.. [CODE] string name = /* The directory path */; system("rmdir /s /q " + name"); [/CODE] | |
Re: You can try this: [Developing a Media Player using C++](http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh986967.aspx) | |
Re: You could at least post your code so we can see where the problem is from. | |
Re: [QUOTE]Please i want to end a program in a function outside function main.[/QUOTE] All functions run in [B]main()[/B], since it's the entry point of the program. No user-defined function can run outside [B]main()[/B]. Once [B]main()[/B] ends, all other functions end. | |
Re: (1) Are you asking for advice concerning the AlphaBeta algorithm or (2)have you written code and you need help to progress further? If (2), post the code you have written so far(using code tags, of course).. If (1), get a good C++ book. | |
Re: [URL="http://www.cplusplus.com/reference/iostream/istream/seekg"]This will help.[/URL] | |
Re: [CODE] #include <iostream> using namespace std; class LoopEx { public: int x ,y; void Ex(){ x = 1; // Point 1 y=3; while(y>0){//Point 2 x=x*y; --y; } cout<<x; } }; int main() { LoopEx F; F.Ex(); return 0; } [/CODE] Point 1 : If you initialize x to zero, any … | |
Re: [CODE] double Rational::division(Rational c) { numerator = numerator * c.denominator; // divides numerator and denominator denominator = denominator * c.numerator; // divdes denominator and numerator return reduction(); } [/CODE] You are multiplying here instead of dividing.. | |
Re: [QUOTE] can you help?. i know some coding [/QUOTE] Show us what you know... We'll help you from there.. | |
Re: [QUOTE] i need with thc coding [/QUOTE] Write it. | |
Re: Your code has a lot of errors.. [QUOTE] Menu soccerClothesMenu("soccer"); [/QUOTE] The Menu struct does not have a constructor that takes a string as a parameter. Rather, the only constructor int the struct: [CODE] Menu(const std::string& name, const std::vector<Menu> subMenus): name(name), subMenus(subMenus){} [/CODE] takes two parameters. [QUOTE] int main(){ { … | |
Re: This is funny.. How can you claim to have studied Java for a year and you don't know how to create objects and classes? Nobody would believe that. | |
![]() | Re: [CODE] try { guess = Integer.parseInt(guessStr); //tells the use to enter a valid integer if (guess < 0 || guess > 10) message = "Enter a number between 1 and 10."; guessStr = JOptionPane.showInputDialog(null, message, chanceStr, JOptionPane.ERROR_MESSAGE); } catch (Exception ex) { [/CODE] Try [B]catch[/B]ing an [B]InputMismatchException[/B] instead of an … |
Re: [QUOTE]Ok the thing I searched into google brought up a ton of nonsense. I want to use variables from a function in main and (more important) variables from main in a function.[/QUOTE] Declare the variables globally.i.e before main() [CODE] #include<iostream> using namespace std; //declare variables here int main(){} [/CODE] | |
Re: Remove the [B]abstract[/B] keyword or you can make [B]SquareBaseContainer[/B] an interface. By the way, [B]SquareBaseContainer[/B] extends [B]BaseContainer[/B], which is also [B]abstract[/B]. Remove the [B]abstract[/B] keyword from there, too. | |
Re: [url]http://www.javabeginner.com/java-object-type-casting.htm[/url] | |
Re: for(loop the following code n times){ pow = pow multiplied by m } So if we are to loop 'pow * 3' 2 times, that would be: pow = 1 * 3 = 3 pow = 3 * 3 = 9 | |
| |
Re: Where's the definition of Update_records() and TimeStep()? and where did you declare NO_OF_PLANTS and plants[]? Please post the full code. | |
Re: [URL="http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/"]This [/URL] should help in your understanding of shallow and deep copying. | |
Re: [CODE] #ifndef personH #define personH class Person { private: //Try making height_ and weight_ protected instead of private static float height_; static int weight_; public: void setHeight(float height); void setWeight(int weight); static float getHeight(); static int getWeight(); }; //--------------------------------------------------------------------------- #endif [/CODE] | |
Re: Can you write assembly programs? if yes, then you should probably read [URL="http://en.wikipedia.org/wiki/Booting#Boot_loader"] this.[/URL] Your understanding of computer architecture will be of help to you, too. | |
Re: You need to also overload the other operators you used in the above code. if you have, post the code. | |
Re: Most of your errors are due to incorrect usage of the "extern" keyword.[URL="http://msdn.microsoft.com/en-us/library/0603949d%28v=vs.80%29.aspx"] This[/URL] should help. | |
Re: A base class, as the name suggests, acts as a 'base' for derived classes. Example: class Car has 3 derived classes, Toyota,Honda and Chevrolet. Functions and variables you want to use in Toyota but not in Honda can be in Car. Also, methods and variables that you want in all … | |
Re: [QUOTE]The program forms the letter [B]Z[/B] by printing n input character symbols on the upper line, n input character symbols on the lower line, and n input character symbols on the diagonal line.[/QUOTE] However, down the line, your output shows the drawing for [B]C[/B], not Z... I don't get your … | |
Re: [QUOTE]The 'idea' behind my loop is that it was supposed to read the player's information and record it up to the number of 'atBats', then count the hits, etc. of that player based on the number of atBats (via the second loop), record that, then start over again but for … | |
Re: If your machine is too slow to run windows or mac, you shouldn't be telling people to post what they do on a daily basis, cos it mostly involves Windows or Mac! you should be thinking of changing your machine.... | |
Re: It seems your sort function is in ascending order, so this should do: [CODE] string test[] = {("Testing sorting strings"), ("Pray this works")}; int array_size = sizeof(test) / sizeof(test[0]);//To find the number of elements in the array for(int i = 0; i<array_size;i++){ if(test[i][0] > test[i+1][0]){ cout<<test[i]<<endl; } else { cout<<test[i+1]<<endl; … | |
![]() | |
Re: [QUOTE] It's not possible to determine if the array is empty or not without knowing the array size. Even then the only way to tell if the array is empty is if the array size is 0. [/QUOTE] You assign the array size to an int variable, then return "true" … | |
Re: The problem might not be from the code fragment posted here. Post your full working code. | |
Re: [CODE]34. if (mark 0<a<50);[/CODE] 'mark' is nt supposed to be there, or were u trying to write 'mark<0<a<50'? | |
Re: Now, Where's your code? Haven't you tried solving this problem yourself? Post your progress if you've attempted this.. Else, have a go @ it, then come back if u have any problems.... | |
Re: I like your code, raptr_dflo, buh why not make use of cout instead of printf()? | |
Re: Read up on the functions and capabilites of C++ Strings.. That would do you a lot of good.. | |
Re: Encapsulation is wrapping data into single unit (e.g A class) Abstraction is hiding unessential parts and showing only essential data. | |
Re: I don't see any problem with your code.. so what exactly is ur complain? | |
Re: That's because ur function prototypes ARE in main()... And try using int main() instead of void()... | |
Re: Writing a compiler?? That defines just 4 basic math operators??? A compiler??!! | |
Re: [QUOTE=;][/QUOTE] Are u posting your assignment for we to solve? | |
Re: Jimmyteoh, U were told to post your code for ur question, not repeat it in another person's post... | |
Re: [CODE] #include<iostream> using namespace std; string parseInputString (string oneline) { string newName; string firstName, lastName; int index; index = oneline.find(' '); int ret = oneline.at(index); firstName = oneline.substr(0, index); oneline = oneline.substr(index + 1, oneline.length() - 1); lastName = oneline; newName = lastName + ", " + firstName + "."; … |
The End.