49,756 Topics
![]() | |
Okay, it's been a long time since I've programmed in C++! Languages change considerably in the last 5 years or so. In reviewing some source code I often see statements like this: [CODE] wxString label; if (name == wxT("Undo")) { label = _("Undo");[/CODE] obviously, I snipped out a lot of … | |
ok so i am suppose to write a program that displays binary and hexadecimal as so 0000 1010 A, but some of my code shows 1C and i dont know how to fix it. please help [code=c++] /* */ #include<iostream> using namespace std; int main() { int arr[8]; char p … | |
i read through loads of stuff and the main thing i saw was the accept button property of the button. but i don't understand how to use this in a C++ windows form application. if there is an easier way or someone (Niek_e) can make it easier for me to … | |
I have created a win32 application in which you can draw different objects(lines, rectangles, etc.) and now I want to save the drawings as bmp files because I already now how to load bmp files. These is as far as I got: [CODE]void OnSave(HWND hWnd) { OPENFILENAME openFile; TCHAR szPath[MAX_PATH]; … | |
I am creating a scripting engine that would execute my own scripting language. The engine does a double pass through the script, the first pass parses the file and builds the data structure and the second executes the script. The error I am getting is when I try to read … | |
ok ok i got it now right i copy it to vector and sort it..... here is the code #include <iostream> #include <fstream> #include <algorithm> #include <string> #include <map> #include <vector> using namespace std; typedef map<string,int> word_count_list; struct val_lessthan : binary_function < pair<string,int>, pair<string,int>, bool > { bool operator() (const … | |
.the program is running .display the frequency of words and sort them from highest count to lowest. my problem is about the duplication of the counts or value of the words.if the value of the word are same it only display the first word&value ...can some one help here is … | |
What is need of default arguments in function overloading in C++? | |
| |
In my readFile.h file, I define void readFileInformation(string filename) in readFile.cpp file, I define void readFile::readFileInformation(string filename) { ifstream inFile; infile.open(filename.c_str(), ifstream::in); ... } in main.cpp file, I used string filename="mgolfinput.txt" readFile filereader; filereader.readFileInformation(filename.c_str()); but for some reason, I couldn't open file. I did try to change path of .txt … | |
Hi, Please suggest me how to check a given tree is balanced using the height of tree. we need to use the avl tree concept. i.e, the difference between height of any left or right subtree is atmost 1. i have written the code for inserting the node, but this … | |
I have been trying for ages to get glut working (in code blocks) and now it works... sort of. I can compile and run applications but it comes up with several warning: ignoring #pragma comment errors in glut.h. I got the glut.h file from [URL="http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/"]here[/URL]. because all other downloads of … | |
Hi, I'm a beginner of C++ programming. I am trying to write a void funtion for the following question but in vain. Please help me. Here's the question: Suppose we want to display the following figure containing the alphabetic character V on yhe screen: #^^^^^^^^^# ^#^^^^^^^#^ ^^#^^^^^#^^ ^^^#^^^#^^^ ^^^^#^#^^^^ ^^^^^#^^^^^ … | |
ok so basically i just wanted to know how to add a string variable between text.. eg. [CODE] string name; cout << "Hello,"name"sucks"; [/CODE] i want to know how to do it all in one line since where i use it there are parameters and they don't allow me to … | |
Does anyone know how to truly select random element from a vector v? I tried this: int rnd; rnd = v[ (int)floor( (double)rand()*( (double)v.size() / (double)RAND_MAX ) ) ]; cout<< "Random element: "<<rnd; But every time it's selecting only one particular element from my vector. It should be random right. … | |
write a c++ programme for implementing gauss-seidel interation method. | |
This is my first time using pointers and I'm having some trouble. So far I have declared a struct named Student which is meant to hold the data for each student. There is an input file with an unknown amount of entries. Each entry has a first and last name … | |
When i run a black screen with cursor appears but nothing prints THANKS INTERFACE [code] //my_int_vector.h class my_int_vector { public: //destructor ~my_int_vector(); //copy constructor my_int_vector(const my_int_vector& b); //constructor that create an empty vector my_int_vector(); /*constructor that create an vector with capacity specified as a parameter but doesn't assign values to … | |
I am getting the following errors 25 D:\calculat.cpp expected `(' before "op" 49 D:\calculat.cpp expected `;' before "op" 53 D:\calculat.cpp `y' undeclared (first use this function) I partly suspect to change it to switch (op) but that gives more errors of the following 27 D:\calculat.cpp expected primary-expression before ':' token … | |
Hello, I am a newbie a C++. I was doing a program where you calculate prime numbers, and it prints prime and non-prime numbers. Here is my code, [CODE]#include <iostream> #include <conio.h> using namespace std; main() { int n = 1; int i = 2; bool IsPrime; int Max; int … | |
#include<iostream.h> main() { int opt,x,y,fact,ans; for(ans=opt;ans!=0;ans++) { cout<<"\n\t\t\t *******MENU*******" <<"\n\t\t\t[1] FACTORIAL OF A NUMBER" <<"\n\t\t\t[2] PRIME NUMBER" <<"\n\t\t\t[3] ODD OR EVEN NUMBERS" <<"\n\t\t\t[4] MULTIPLICATION TABLE" <<"\n\t\t\tYOUR CHOICE: "; cin>>opt; switch(opt) { case 1: { cout<<"\nThis program tells you the Factorial of the number you have input..."; cout<<"\nInput limit: "; cin>>y; … | |
Not stuck and no real question, which is unusual for me. Just a comment. The 2nd term in a for loop establishes the condition under which the loop terminates. For example, this loop terminates when i increments to 5... for(i=0; i<=5; i++) { ... ... } It'll execute its contents … | |
#include <iostream> using namespace std; class Fraction { public: Fraction() : num(0), denom(1) {} Fraction(int num, int denom) { setNum(num); setDenom(denom); } int getNum() const { return num; } int getDenom() const { return denom; } void setNum(int num) { this->num = num; } void setDenom(int denom) { if (denom) … | |
This is a method I used for adding a object, flightnode, into a linked list. Basically it takes in the value in and puts it in order based on the int flightno in the flightnode object. It works fine until a value needs to go at the end of the … | |
Hy there, I'm a newbie so be patient pls. I have a small but useful class (let's call it Class1), and another class, more complex (let's call it Class2). I need to use in the Class2 instances of the Class1. I need to declare objects of Class1 both in private … | |
I'm kind of stumped on a project. The purpose of the project is to decode a floating point number to find it's sign, exponent, and significand, etc... So far I've been able to get a user input float number into binary32 format using few lines of assembly code(professor told us … | |
I have a native code snippet that I am going to write in managed code instead. The native snippet code look like this: [code] std::string RClammer = "]"; std::string BigLine = "aaaaaaaa]aaaa"; int pos = 0; while(std::string::npos != (pos = BigLine.find(RClammer, pos))) { BigLine.insert(pos + 1, " "); pos = … | |
What are some good Unix application developer books? Thanks. | |
Maybe somebody could help me find code for upsampling audio data from .wav file? I have it stored in an array of SHORT integers. Thank you in advance. | |
ok so i have used ShellExecute() before but with a specific value eg. "http://www.facebook.com" but now i want this program to be more flexible and allow the user to put the website he wants to. the thing is i made a string like this [CODE]String ^URL; ShellExecute(NULL,"open",URL,NULL,NULL,SW_SHOWDEFAULT)[/CODE] this gives me … |
The End.