49,757 Topics
| |
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"; … | |
i am using turbo c++ 3.0 but it has not good graphics.i try visual studio and dev c++ but its syntax is changed. i want a compiler that has same syntax like turboc++. plz name it and give me a dowload link for 64bit os. | |
#include<stdio.h> #include<conio.h> void main(void) {#include<stdio.h> #include<conio.h> void main(void) { clrscr(); int item,lb=0,ub=9,mid; int DATA[10]={1,2,3,4,5,6,7,8,9,10}; int beg=lb;int loc;int end=ub; mid=(beg+end/2); for(int i=0;i<10;i++) { printf("%d",DATA[i]); printf("\nEnter item"); scanf("%d",item); while(DATA[mid]!=item &&beg<=end) { if(item<DATA[mid]) end=mid-1; else beg=mid+1; } mid=(beg+end)/2; } if(DATA[mid]==item) { loc=mid; else printf("loc is %d",mid); else printf("loc is null"); } getche(); } | |
I want to convert some numbers to binary, octal, and hexadecimal.. for example: . DECIMAL......BINARY......OCTAL.....HEXADECIMAL ................................................................... 1.................00000001.....001.......1 2.................00000010.....002.......2 And so on.. | |
Dear Kind-Coders, I am trying to learn to use boost::shared_ptr to manage the lifetime of a DLL, but I am having a type conversion problem whilst setting it up. Please see the following code: #include <boost/make_shared.hpp> int main() { { class CMyClass { public: CMyClass() {} ~CMyClass() {} int MyInt; … | |
Well I just started C++ and I'm trying to run the basic "Hello World" program. But it didn't work i tried EVERYTHING i even clicked the delete button. But NOTHING I don't know how to run a C++ program. ;( So can you please help me? ;) | |
The End.