49,756 Topics

Member Avatar for
Member Avatar for edgar5

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 …

Member Avatar for edgar5
0
135
Member Avatar for ROTC89

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 …

Member Avatar for sandeepss6s
0
112
Member Avatar for evilguyme

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 …

Member Avatar for evilguyme
0
79
Member Avatar for Cosmin871

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

0
44
Member Avatar for Talguy

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 …

Member Avatar for Talguy
0
115
Member Avatar for markrezak

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 …

Member Avatar for William Hemsworth
0
175
Member Avatar for markrezak

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

Member Avatar for markrezak
0
185
Member Avatar for sohaib770
Member Avatar for Lerner
0
68
Member Avatar for evilguyme
Member Avatar for lostmonkey

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 …

Member Avatar for Nick Evan
0
82
Member Avatar for Gaiety

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 …

Member Avatar for Barefootsanders
0
131
Member Avatar for MattyRobot

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 …

Member Avatar for MattyRobot
0
134
Member Avatar for shahanakazi

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: #^^^^^^^^^# ^#^^^^^^^#^ ^^#^^^^^#^^ ^^^#^^^#^^^ ^^^^#^#^^^^ ^^^^^#^^^^^ …

Member Avatar for Barefootsanders
0
159
Member Avatar for evilguyme

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 …

Member Avatar for Nick Evan
0
97
Member Avatar for samm22

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

Member Avatar for samm22
0
136
Member Avatar for Anjana Patel
Member Avatar for ithelp
-1
128
Member Avatar for thisisanfield.1

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 …

Member Avatar for thisisanfield.1
0
138
Member Avatar for lotrsimp12345

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 …

Member Avatar for mrnutty
0
237
Member Avatar for buriza

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 …

Member Avatar for NathanOliver
0
98
Member Avatar for Doughnuts

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 …

Member Avatar for Doughnuts
0
279
Member Avatar for uNpReDiCtAbLe

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

Member Avatar for sfuo
0
127
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
118
Member Avatar for jdub69420

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

Member Avatar for StuXYZ
0
123
Member Avatar for DeadJustice

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 …

Member Avatar for StuXYZ
0
106
Member Avatar for julia2009

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 …

Member Avatar for StuXYZ
0
193
Member Avatar for JainishP

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 …

Member Avatar for JainishP
0
189
Member Avatar for Darth Vader

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

Member Avatar for Darth Vader
0
273
Member Avatar for serkan sendur
Member Avatar for dpreznik

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.

0
76
Member Avatar for evilguyme

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 …

Member Avatar for evilguyme
0
479

The End.