49,761 Topics
| |
write a program using function in 'cmath.h' to demonstrate the usage of 9 commnads in cmath header file . using 'loop control structures' #thanks for any help | |
I read about pointers and it says that array names can be used as pointer constants and pointers can be used as array names and here is an example that prove the first statement (`array names can be used as pointer constants`) #include<iostream> using namespace std; int main() { int … | |
Hi Daniweb programmers.I am a kenyan guy in University of Nairobi Doing an undergraduate degree in CIVIL ENGINEERING but I am a teaching myself C++ because I feel an inborn calling for coding. I appreciate the forums i have already seen. like Bjarne stroutsup said in an interview with Daniweb, … | |
I defined two class, one it's call Movil and the other it's call Camion which it's a derived class of Movil. The code that I am talking is: #include <cstdlib> #include <iostream> //class definition class Movil { int ruedas; float velocidadMax; public: Movil (int ruedas=0, float velocidad=0); void setRuedas (int … | |
This is a timer class that I wrote a while ago (cleaned up a bit for the snippet) for adding delays in some of the games I have written over the years. Note: I normally have the class functions in a .cpp file but since it looks like I can … | |
I feel that following is the conclusion in C++ coding related to Class and access specifiers. We know that we are hiding the data by making private or protected. But there are ways to access it. The one who does not know how to access it will be confused but … | |
So i don't really understand how I will calculate the time complexity for my code, I've had a hard time with it and I would really need some help. the exponent is N all the time. So how will i find the time complexity in N-time(bits).. for(int i = 0; … | |
Hey everyone, Im creating a Tic-Tac-Toe game and i was wondering if i would need to hard code my function in order to get "pretty" output. Like underscores between the rows and a line between the columns. Pretty much have the game in a table labeled columns/rows with the column … | |
I need help with my big integer calculator program. The program should receive two large integers using vectors and calculate the sum, difference, product, and quotient o the two integers. The main file is: [code]#include <iostream> // cout, <<, >> #include <fstream> // istream, ofstream #include <string> // string #include … | |
Is it possible to do the following as you can for a C++ string. I can't seem to do this for a Cstring? That is, add characters to the Cstring the same way? eg // lets assume this vector is full of characters vector<char> charvec; string str; const char* Cstring; … | |
I have a problem in c, i want to achieve this kind of thing using the code i written below. The input and output should be like this: Input Freq Output Freq 1 0,1,4,2,5,3 add two first (0+1) 0,1,4,2,5,3,1 2 4,2,5,3,1 add min and last (2+1) 0,1,4,2,5,3,1,3 3 4,5,3,3 add … | |
I am relatively new to C#, does anybody have a simple example of how calling C++ from C# would be done? I heard that C# can call other languages. | |
For the if discriminant < 0 statement, I need to not only display the error message, but I must display the complex roots in the correct format for complex numbers. How should I go about that? #include <iostream> #include <cmath> using std::cout; using std::cin; int main() { int a = … | |
So I'm new to C++ and I am doing a project that requires the creation of a menu for a simple game. The project instructions are: Write a program that will ask the user to purchase a vehicle for their character in a racing game. Tell them how much their … | |
Hello everyone! I have a homework assignment that I'm just not understanding...We're tyring to implement 4 total ciphers. I have the Caesar Cipher down: #include <cstring> #include "algorithms.h" void caesarEncrypt( const char plaintext[] , char ciphertext[], int key ) { int idx; for( idx = 0; idx < strlen(plaintext); idx++ … | |
I'm just trying to scroll through a input file, fin is the object name and it goes into an infinite loop. I'm using this check !fin.eof what am I missing or not understanding? #include <iostream> #include <fstream> #include <cctype> #include <cstdlib> #include <string> using namespace std; // ------ PROTOTYPES --------------------------------------------- … | |
I want to write a program which generates armstrong numbers between any two numbers! | |
If i uncomment the lines in between, all the records get deleted. Why?? void Hatao() { int no; system("cls"); cout<<"\n\n\n\tDelete Record"; top:cout<<"\n\nPlease Enter The roll number of student You Want To Delete: "; cin>>no; fp.open("student.dat",ios::in|ios::ate); fp.seekp(0,ios::beg); fp.seekg(0,ios::beg); fstream fp2; fp2.open("Temp.dat",ios::out); //int flag=0; //if (st.retrollno()==no) //flag=1; //if (flag==0) //{ // cout<<"\nRecord … | |
hello , after learning on functions in c++ , i created several functions and now i wanna create a gourp which will have these several functions at a place(i think its done with header file). so, i think if i create a header file and include these all these functions … | |
Hi all, I’ve been given told to convert a standard C++ program into an object-oriented one, using the principals of polymorphism, encapsulation and inheritance. Our lecturer covered all three principals in one 45 minute slot. I’m completely stuck and would be grateful for any help. The standard C++ program accepts … | |
number1 = 0; number2 = 0; while(number1 < 5) number1 ++; number2 += number1; Question#1 : what is the value of number1 when the loop exits? Question#2 : what is the value of number2 when the loop exits? Question#3 : if the statement number1++ is changed to ++number1, what is … | |
Hi, Im a new beginner to C++ and i have a question. I have a .txt document with many different values. I would like to return a value from the .txt file depending on what value i give in. I want to pass how many lines in the .txt file. … | |
Hey guys, im building a Tic Tac Toe game and im checking for a winner via this function(code below), Im juct wondering if there is a better way of doing this then how im doing it. if so could you point me in the right direction thanks :) The array … | |
This program is supposed to run through the menus to eventually display the area or volume of a shape depending on the user's menu choices and input. However, it won't run the final menu and I'm not sure why. There aren't any problems when it goes through the debugger, it … | |
would it be possible to right a program that would create a sort of virtual audio device that would show up under playback devices and that i could set as default, the purpose of this virtual audio device would just be to redirect the audio stream to a different device … | |
This is the function : node* remove (node* p_tree, int key) { if ( p_tree == NULL ) { return NULL; } if ( p_tree->key_value == key ) { // the first two cases handle having zero or one child node if ( p_tree->p_left == NULL ) { node* p_right_subtree … | |
Hello, Can someone help me understand what is (if it is) the difference between `string* myStr` and `string *myStr`? Or any other type of definitions like that: `int* myValue` vs `int *myValue`, `char* myChar` vs `char *myChar`. The position of the "star" is confusing me. I only used pointers like … | |
i am making my own trainers for games using c++, one of the main functions i use is the WriteProcessMemory but this is all good if you know the byte codes for the instructions i want to change like the nop instruction is 0x90 for example (DWORD) instructioncode = "0x90"; … |
The End.