51,593 Topics
![]() | |
I want to write a function that displays the frequency of occurrence of an element entered by the user in a stored array. The array always has the following elements: 4, 2, 7, 10, 9, 7, 6, 10, -8, 7, 9. well i wrote this one but i have a … | |
I need different source code of digital clock plz exept in graphic forms | |
i wrote this code yesterday and i traced it myself but the problem is the array doesn't store any number in it and the output was like this : //convert from decimal to binary #include<iostream> using namespace std ; void main(){ int n,c=0,*pointer,temp=0,r,i,y ; cout<<"Enter number\n"; cin>>n; y=n ; for(;;){ … | |
i hope to connect console output to windows form in panel2. i have no idea how to do it... please help me | |
i want to get input from a textbox in visual c++ 2010 window form application i try this but it not work private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { std::string m; m==textBox1->Text; MessageBox::Show("developed by basit "); } }; help me plzz | |
Could anyone help me to write a digital clock in C++ (with some charachters,i mean the time numbers should be made by charachters)? i'm confused | |
Can anybody tell me how can i calculate x decimal numbers of pi, if my input is 2 than output should be this 3.14 if my input is 4 then output is 3.141. I have tried code like this but doesnt work how i want. pi +=3+4/(k*l*m) - 4/(a*b*c); //+ … | |
hello friends i need help in c++ programe i want to print the diamond of the type shown in picture any one help me in this regards............................ if possible then send me email at <snipped email> | |
#include <iostream> #include <string> #include <stdlib.h> #include <cstring> using namespace std; class Fraction { private: int num, den; // numerator & demoninator public: Fraction() { set(0, 1); } Fraction(int n, int d) { set(n, d); } void set(int n, int d) { num = n; den = d; normalize(); } … | |
McCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91 that takes as input a positive integer N and returns a positive integer defined as follows: If N <= 100, then f91(N) = f91(f91(N+11)); If N >= 101, then f91(N) = N-10. … | |
write a c++ program to acquire scores from a Student and determine the grade based on his/her scores: <30 is fail 31 to 50 is pass 51 to 60 is credit 61 to 80 is very good 81 to 100 is excellent | |
i made c++ algorithm code. But i don't know how to connect this output which shows in console to windows form application program. please tell me about detail... | |
void cAppMath::vregisterFunc(int index, int(*fPtr)(int a, int b)) //Application to register their functions { arrFptr[index] = fPtr; } int main() { appObj.vregisterFunc(EN_ADD, &cAppMath::add); //application that is registering the callbacks. } { Getting follwoing ERROR in vregisterFunc() func call. Error 1 error C2664: 'void cAppMath::vregisterFunc(int,int (__cdecl *)(int,int))' : cannot convert argument 2 … | |
Hello Guys, I create a small program than allows user to create bank account and add or get money but now i want to edit my code to accept more than one account how can i do it ? #include "header.h" Account::Account(){ int i=0; cout << "To create account enter … | |
i need to create a deck of cards and shuffle it as well and display and sort 4 cards as a hand ahich i have done already please i need to include straight, full house, pair, 3 of a kind and 4 of a kind i have no clue how … | |
| |
Hi guys, after learning that MingW is newer than Cygwin, I immediately switched over to MinGW and deleted my Cygwin file. I have added the MinGW directory into my Path Variable and also separately downloaded the MSYS which contains the make.exe program. Everything seems fine... until when I ran the … | |
#include<iostream> using namespace std; class Singleton { static Singleton * s; Singleton() { } public: ~Singleton() { s = NULL; } static Singleton * getInstance(); void print() { cout<<this<<endl; } }; Singleton* Singleton::s=NULL; Singleton* Singleton::getInstance() { if(s == NULL) { s = new Singleton(); } return s; } int main() … | |
I am trying to write a program that takes unlimited input of names using dynamic memory and stop when the first character is the enter key. i tried, but i am unable to do it. #include "ReadString" void main() { const int NumNames(20); char **pNames; pNames=new char [NumNames++]; for (i=more;i<NumNames;i++) … | |
Good day. I was surprised to see that there are no members on objects declared as IFSTREAM and OFSTREAM. I have this code; ifstream indata; ofstream outdata; indata.open(""); outdata.open(""); It can't seem to recognize the member "open". Why is that? Any solution? | |
Hey, guys. Find the sum of all the primes below 2000000. My code: *main.cpp* #include <iostream> #include <vector> #include <cmath> #include "Sieve.h" using namespace std; typedef unsigned long long int ulli; ulli Sum = 0; ulli Sum_of_Primes(vector<bool>, ulli&); ulli Sum_of_Primes(vector<bool> Primes, ulli& Sum) { for(ulli a = 2; a < … | |
from MSDN: https://msdn.microsoft.com/en-us/library/windows/desktop/dd145213%28v=vs.85%29.aspx "An application returns zero if it processes this message." see these code on my label control: case WM_PAINT: { PAINTSTRUCT test; BeginPaint(inst->hwnd, &test); image imglabel(inst->imgtest.width(),inst->imgtest.height()); brush brshbackcolor(inst->clrBackColor); imglabel.Backcolor=inst->clrBackColor; brush brshTransparent; FillRect(imglabel,&test.rcPaint,brshbackcolor); if(inst->imgtest.haveimage()) DrawHICONtoHDC(imglabel, inst->imgtest); imglabel.DrawText(inst->strCaption); pen penColor(1,2,RGB(0,255,0)); penColor.ToDC(imglabel); imglabel.DrawRectangle(10,10,10,10); pen penColor2(1,2,RGB(255,0,0)); penColor2.ToDC(imglabel); imglabel.DrawLine(0,0,20,20); pen penColor3(1,2,RGB(0,0,255)); penColor3.ToDC(imglabel); //brshTransparent.ToDC(imglabel); … | |
Hi guys, I just found out that setw is not recognized in Netbeans C++ with Cygwin even when IOMANIP is included in my program. Is there anything I can do for this? I need to format the output of my program, thanks. | |
My code is working almost the way I need it to. However, when I run the program I am getting this Welcome to Johnny's Restaurant Bacon and Egg $2.45 Muffin $1.98 Coffee $0.50 Tax $0.25 Amount Due $5.18 When I want to get this: Welcome to Johnny's Restaurant 1 Bacon … | |
This is supposed to used quick sort using the header "arrayListType.h using quick sort and get the numbers entered smallest to largest but I'm not sure on how to do it. Can I please get some help? #include <iostream> #include "arrayListType.h" #include <cstdlib> using namespace std; void printList(arrayListType<int>& list); void … | |
# Im a beginer in programing language, i just started programing using turbo c++ , however every time i download a c++ software from net it turns out to viral and it doesnt work properly. please kindly send me a link from which i can install turbo c++ as soon … | |
Hi, I managed to change a cursor in C++ windows console size using the function HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_CURSOR_INFO cz; cz.dwSize =100; cz.bVisible =TRUE; SetConsoleCursorInfo(output, &cz); But I'm having a hard time to make the cursor not to blink. I couldn't find any function in MSDN to do that. … | |
Hey, guys. A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a² + b² = c². For example, 3² + 4² = 9 + 16 = 25 = 5². There exists exactly one Pythagorean triplet for which a + b + c … | |
HI everyone, I need help in c++. Problem : I want to write a program that calculate x digits of pi. Like if my input is 3 output should like this 3,14 or this 3,145 if my input is 10 output should like this 3,14529xxx or lik this 3,14529xxxx. I … | |
Hi all, This is something very basic i know. I just wanted to avoid some confusion. What is the difference between char *names[100]; and char names[100]; This is what i know char names[100]; - its just a character array which can hold 99 characters and the last one will be … | |
If i have an array of names char *names[100]; (stored as pointers to strings), how to find the name that appears the most times in the array and how many times it appears. (a) if only one “mode” (b) multiple “modes” I'm thinking of implementing something similar to selection sort … | |
Hello, guys. How would I deal with a variable that needs to be biggers than an unsigned long long integer? Thank you. | |
Hello, guys. This challenge asks us to find the 10001-th prime. Here's my code: // A reasonable approximation is to say that the n-th prime is such that p(n) = n*(log n + log*(log n) - 1). // With that in mind, we can say that the 10001-th prime is … | |
I am trying to store a value from a selected row from one table into another. My code is as follows. string CustomerID = textBox1.Text; SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString); con1.Open(); SqlCommand myCommand = new SqlCommand("Select CustomerID, Name from TableCustomer WHERE (CustomerID like '" + CustomerID+ "')", con1); SqlDataReader rdr … | |
HELLO everyone i have a problem with which link is here can anyone help me please http://acm.epoka.edu.al:8080/en/problem-pid-c50f?ps=1&smt=a&smpwid=0 | |
This is what I have so far #include <iostream> #include <iomanip> using namespace std; const int NUM_SECTIONS = 3, NUM_ROWS = 5, NUM_COL = 9; int main() { int seatTable[NUM_SECTIONS][NUM_ROWS][NUM_COL] = { { { 100, 100, 100, 100, 100, 100, 100, 100, }, {100, 100, 100, 100, 100, 100, 100, … | |
I've just started learning C++ on Linux. I have written a very small program which compiles but I get run time errors everytime I run it. The code is shown below: #include<iostream> int DoubleOf(int n); int main() { std::cout << "Double of 5 is " << DoubleOf(5); return 0; } … | |
how do you write a c++program using the do while and while do loop to list prime numbers between one and thirty | |
Hello there, I am having a problem with small application. I have used gdb and following error appeared: strlen() segmentation fault. Could anyone help me to find out solution? int main(int argc, char* argv[]){ char* name = malloc(strlen(argv[1])); name = strcpy(name, argv[1]); printf("%s \n", name); return EXIT_SUCCESS; } | |
Hi guys I am really having trouble on what to do with my program. We are asked to make a cashier's program and I don't know how to do the the Receipt... I don't know what to do in the order part... how about if the customer will order 3 … | |
Write a program to check the password is too strong or strong or weak & also check the password is validate or not.. you can use code of c/c++ and you want .... | |
Write a program that accepts three values from a user and print the two highest value and thier sum. | |
OK, so I've asked a question like this before and I thought I understood the answer (solved) but I am having problems again and I still do not understand why. I am compiling with MinGW. Here's the code: string filename="D:/__GNU analyze/test/bin/Debug/_ClusterFormat/Test2.6d .txt"; fstream file, file2; string cluster="frame"; string line; Matrix … | |
I have this in a code: ` int load_snapshot(char *fname, int files) { FILE *fd; char buf[200]; int i, j, k, dummy, ntot_withmasses; int t, n, off, pc, pc_new, pc_sph; #define SKIP fread(&dummy, sizeof(dummy), 1, fd); for(i = 0, pc = 1; i < files; i++, pc = pc_new) { … | |
hai can you please give me in detail how to write a c program for a sensors | |
plz some one explain in details this code : we have array of 9 cells and 0 present empty locations we want solution of this array (no number will be repeated) also if there is any way to call this functions in main so as the program runs succesfully plz … | |
Hey guys im having a problem in structures.. i dont know how to initialize a an array of 10 contact instances.. plz help me out. this is my question statement.. "Declare a structure Contact that has a name, address, mobile number. Now create and (hardcoded) initialize an array of 10 … | |
hi i have a unknown string in c++ containing "\n" "\t" etc. say; string unknown1="\n\t\n\t\n\n\n\n\n"; now I want to print "\n\t\n\t\n\n\n\n\n" to the screen explcitly other than a bunch of empty spaces.... how should I do that? remember that I don't know what is in unknown1... | |
I have downloaded the program from here http://www.tightvnc.com version 2.7.10 and compiled successfully using visual studio 2013. One is the tvn server and other is the viewer. We connected successfully the server and viewer using my friend’s laptop pair with server and client interaction. When the application runs all the … |
The End.