- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 9
- Posts with Upvotes
- 9
- Upvoting Members
- 9
- Downvotes Received
- 7
- Posts with Downvotes
- 7
- Downvoting Members
- 5
67 Posted Topics
![]() | Re: Definitivelly the most powerfull language of all times is... English. The most powerfull computer is an... Engineer. Explain your problem to an Engineer in English, and he/she will solve it! Easy, isn't it? |
Re: I think you are doing a good job. Continue. I recomend you to change the reverse function with: void reverse(char line[], int len) { int i; char tmp; --len; for(i=0; i<=len/2; i++) { tmp = line[i]; line[i] = line[len-i]; line[len-i]=tmp; } } To understand it, you must work with a … | |
Re: See http://www.parashift.com/c++-faq/serialization.html There, it is defined as: Serialization lets you take an object or group of objects, put them on a disk or send them through a wire or wireless transport mechanism, then later, perhaps on another computer, reverse the process: resurrect the original object(s). The basic mechanisms are to … | |
Re: Yes, it is perfectly possible to solve that problem in C++. | |
Re: I recomend you to use the function `int toupper( int ch )` defined in header `<cctype>` | |
Re: A for that do something 10 times can be written like this: for(int i=1; i<=10; ++i) { //... } | |
Re: Consider you have a counter (c) that goes from 1 to 5. The number of stars you what to print is `s = 6-c`. In this way, when c values 1 s values 5, when c values 2 s values 4, when c values 3 s values 3, and so … | |
Re: This link [Stackoverflow](http://stackoverflow.com/questions/2799023/what-exactly-is-a-reentrant-function) can give you more information. | |
Re: The disadvantage of multiple inheritance is that for using it you need to know more than for not using it. However, if you know how to use it, it is a fantastic tool. In other words, knowing a little of multiple inheritance, you can make a mess; knowing a lot, … | |
Re: Replace `strVec.push_back(getline(about));` with `strVec.push_back(getline(infile));` Then show the vector `strVec` Then sort the vector `strVec` Finally show again the vector `strVec` | |
![]() | Re: I think that rubberman has been a little exagerated because this is neither for a PhD nor even Master but he is right in that this is very difficult for a beginner. You must learn about WEB servers and how to create utilities there. Also you need to learn about … |
Re: I recomend you to learn C++11 directly. Learning C is the long way to C++98 to C++03 to C++11 and do not have any benefit. As a matter of fact, the style of programming and the way of think has evolved a lot. With C++11 there are many things you … | |
Re: Sorry but I can't tell you a book like that. > Also, is there an advantage to learning C before you learn C++? No, there isn't. As a matter of fact, it is not recomended at all. Learn C++ directly. Knowing Python you have an advantage but resist the tentation … | |
Re: The memory is measured in bytes. 1k bytes are 1024 bytes (not 1000 bytes). This is because the memory space is expresed in powers of two: 2^0=1 2^1=2 2^2=4 2^3=8 2^4=16 2^5=32 2^6=64 2^7=128 2^8=256 2^9=512 2^10=1024 <--- This is why 1k of memory has 1024 bytes. 2^11=2048 2^12=4096 <--- … | |
Re: On line 18, change `get_values(*r, *v);` with `get_values(&resistor, &volts);` Also you can change line 39 from `scanf("%f", &*r);` to `scanf("%f", r);` and line 43 from `scanf("%f", &*v);` to `scanf("%f", v);` but these are not stricly necessary. | |
Re: `data_search` is an integer. But is `current->ID` also an integer? It seems that `current->ID` is a `string`. Probably you can use `std::stoi(current->ID)` to solve the problem. | |
Re: Daniweb is not a homework service. Please provide evidence that you've attempted a solution on your own. | |
Re: D is something like to try to create a car that can fly like an airplane and transport like a jumbo but with the facility to dive under the sea. And all of these applying restrictions to what C++ can do very well, just because something has decided that some … | |
Re: Daniweb is not a homework service. Please provide evidence that you've attempted a solution on your own, as per our rules. | |
Re: Do you want that someone make your homework? | |
| |
Re: Probably you don't need to go with the debuger to all of your functions. In that case, I also sujest you to compile some files with -O3 (where you are sure that everything is OK) and others (where you will need to debug) with the -Og option, following the NathanOliver … | |
Re: > 1) Is this statement correct: In memory, elements of an array are stored "against" each other (I think more precisely, contigious space is allocated for them?) and a pointer to an array points to the first element. Yes it is correct. | |
Re: Your problem can be fixed just adding two parenthesis. The idea is to put your str string into a scope `{/*...*/}` and, at the end of the scope, your str string memory will be automatically released. //... fileIn.open(fileName, ios::in | ios::binary); { string str((istreambuf_iterator<char>(fileIn)), istreambuf_iterator<char>()); cout << str << endl; … | |
Re: If you don't want to programm your own random number generator but instead want to use something done, C++11 have a complete random number library defined in <random>. There, the standard library defines facilities for generating (pseudo-)random numbers with different distributions. I consider this library one of the most complete … | |
Re: Just to start: class Shape2D { public: double area() = 0; }; class Paralelogram : public Shape2D { public: double perimeter() = 0; }; class Circles : public Shape2D { public: double diameter() = 0; double circunference = 0; }; class Shape3D { public: double volume() = 0; }; class … | |
Re: First I recommend making your board two rows bigger and two columns wider so you will not change your code when you are at the border. You must 'mark' the boxes that are out of the bord with some special value. Then, if you are at the position `r,c`, for … | |
Re: I don't think this web is to teach how to crack a programm. Anyway, if you want to crack a code, you need to know a lot that seems you don't. So I recomend don't try to solve this here, you must study a lot. Your first step shuld be … | |
Re: If you want to count the total numbers of `;` in your file, don't use an array `int dotcoma[150]`, just use a simple variable `int dotcoma` and increment it when you find a `;`. On the contrary, if you want to count the number of `;` on each line, do … | |
Re: Give more information, for example, your thesis will be in computer science? | |
Re: Your program should structure something like this: int low=1; int high=100; while(low<high) { int half=(low+high)/2; std::cout << "Is your number greather than " << half <<"? (Y/N): "; char answer; std::cin >> answer; if(answer == 'Y' || answer == 'y') low=half+1; else high=half; } std::cout << "\nYour number is: " … | |
Re: My recomendations are: You must write the << operators I don't think is a good idea to Derive `Deck` from `Hand` I recomend you to use the following hierarqui: Card n.........1 GroupOfCards | | | | Hand Deck | | GenericPlayer (v) | | | | (v) Player House (v) … | |
Re: The same question had been asked on C++ forum. | |
Re: Replace #define TRUE = 1; #define FALSE = 0; with #define TRUE 1; #define FALSE 0; I don't know what you program must do but with this replacements there should not be more compiler errors. Good luck. | |
Re: Taking into account that: If a number N ends in zero then the remainder of N integer divided by ten is zero You could count the number of zeroes inside a number N with the following algorithm: Initialize Counter to zero While N is greather than zero IF N ends … | |
Re: You need to include a for clause to delete the required column on every row: `for(auto& r : vec) r.erase(r.begin()+col)` | |
Re: I recomend you to use strings, neither chars nor pointers. `#include <string>` and then `string s = "Ctor of class Brain Called";` finally `void Taxi::PrintTaxi(const string& a)` Remember, you are using c++ not c. | |
Re: Hi, you can do something like this: //... cout<<"Do you want to continue (Y/N): "; cin>>t; if (t == "Y" || t == "y") break; // Or any other way to get out of the f(;;) loop like exit(); cout<<"Please enter the ticket type:F,B,or E: "; cin>>t; //... | |
Re: I recomend you to use switch...case clause: for(int i=1; i<=12; i++) { cout << i << ' ', switch(i) { case 1: cout << "My first message\n"; break; case 2: cout << "My second\n"; break; //... } } | |
Re: You are making a some mistakes with pointers. Don't use `delete[] elemento` but `delete elemento` Don't use `delete[] prossimo` but `delete prossimo` You can not write something like `delete pun[i];` because `pun` is not an array. Declare the variables `n` and `m`. | |
Re: I recomend you to use a little endian representation of your string numbers, because it is easy to manage the carry. You can try something like: string add(const string& n1, const string& n2) { // Add two string numbers in little-endian format (reversed) const string& min = n1.size()<n2.size() ? n1 … | |
Re: We don“t do the homework of anybody. Work on your problem and make some questions. We will only give you some hints. | |
One of my students make me a question (which answer i know) but I think could be instructive to formulate the same question here so many people can learn about it. The question is: How to implement a copy assignment into a Derived class? Consider the following class A: class … | |
Re: I recomend to you to use `vector<int> v` and `sort(v.begin(), v.end());` all your program can be written in less than 10 lines. |
The End.