49,757 Topics

Member Avatar for
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
457
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
234
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
211
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
224
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
147
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
143
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
356
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
Member Avatar for Adeel Rahat

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.

Member Avatar for ddanbe
0
323
Member Avatar for Saba _1

#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(); }

Member Avatar for Moschops
0
143
Member Avatar for ryan.jay.ong

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

Member Avatar for AndrisP
0
176
Member Avatar for Elixir42

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

Member Avatar for Elixir42
0
2K
Member Avatar for schugantor

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? ;)

Member Avatar for mike_2000_17
0
159
Member Avatar for YnnEnu

The End.