49,761 Topics

Member Avatar for
Member Avatar for zaim.notty

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

Member Avatar for Ancient Dragon
0
97
Member Avatar for Learner010

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 …

Member Avatar for deceptikon
0
154
Member Avatar for EDWIN MUGAMBI

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, …

Member Avatar for Dani
0
293
Member Avatar for jocker403

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 …

Member Avatar for rubberman
0
201
Member Avatar for sfuo

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 …

Member Avatar for dexblack_1
0
12K
Member Avatar for Ketan022

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 …

Member Avatar for mike_2000_17
0
170
Member Avatar for zangazanga

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; …

Member Avatar for vinayemani
0
459
Member Avatar for brandon66

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 …

Member Avatar for L7Sqr
0
238
Member Avatar for POW

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 …

Member Avatar for Daniel_19
0
2K
Member Avatar for furalise

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; …

Member Avatar for furalise
0
291
Member Avatar for Shekhawat_1

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 …

Member Avatar for Shekhawat_1
0
215
Member Avatar for overwraith

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.

Member Avatar for Fenrir()
0
76
Member Avatar for Emma_3

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 = …

Member Avatar for DavidB
0
310
Member Avatar for Zilphia

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 …

Member Avatar for jeremy316
0
719
Member Avatar for alysha.recore

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++ …

0
99
Member Avatar for mixelplik

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 --------------------------------------------- …

Member Avatar for jamesjvj
0
163
Member Avatar for prashantsharmazz
Member Avatar for NathanOliver
0
173
Member Avatar for Bhat kamran
Member Avatar for NathanOliver
-1
59
Member Avatar for utkarsh009

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 …

0
99
Member Avatar for Learner010

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 …

Member Avatar for Learner010
0
227
Member Avatar for zekesteer

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 …

Member Avatar for Step-hen
0
2K
Member Avatar for bEedzay

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 …

Member Avatar for AndrisP
0
205
Member Avatar for Roobin

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. …

Member Avatar for Roobin
0
253
Member Avatar for brandon66

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 …

Member Avatar for brandon66
0
217
Member Avatar for Emma_3

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 …

Member Avatar for AndrisP
0
217
Member Avatar for A Haunted Army

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 …

Member Avatar for A Haunted Army
0
148
Member Avatar for Sanjeetjmp
Member Avatar for nhrnjic6

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 …

Member Avatar for rubberman
0
144
Member Avatar for Seba Sama

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 …

Member Avatar for rubberman
0
363
Member Avatar for glenc70

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"; …

0
86

The End.