49,761 Topics
| |
Hi iam trying to make dual function visual c++ button what I did was [url]http://www.4shared.com/file/105379147/23d04050/dualactionmfcbutton.html[/url] I want it to work can anyone help me ? Thanks | |
I'm having problems reading taking an input using cin.getlin [CODE][LIST=1] [*]cout << "Enter record: "; [*]cin.getline(title, 100); [*]csis << "Enter record title: " << title << endl; [*]rec->setTitle(title); [*]cout << "Enter performer: "; [*]cin.getline(name, 100); [*]csis << "Enter performer: " << name << endl; [*]rec->setPerformer(name); [/LIST][/CODE] The program jumps to … | |
[code=cplusplus] #include <iostream> #include<string> using namespace std; int main() { string str1="Amusement Park"; string str2="going to"; string str3="the"; string str; cout<<str2+''+str3+''+str1<<endl; cout<<str1.length()<<endl; cout<<str1.find('p')<<endl; cout<<str1.subtr(1,5)<<endl; str="ABCDEFGHIJK"; cout<<str<<endl; cout<<str<<endl; cout<<str.length()<<endl; str[0]='a'; str[2]='d'; cout<<str<<endl; return 0; }[/code] | |
Hi, I was creating a Gui for one of my classes and I hit a major bump. I am trying to take words from a text file and just display it in the text box. I know how to read files, what I don't know is how to change the … | |
Hi, do not know how possible is this but here it goes, i'm trying to declare an array once a program is running. This is how i'm thinking: [CODE][LIST=1] [*]int size; [*]cout << "Enter size of array: "; [*]cin >> size; [*]Holding *holdLib[size]; //this is a base class pointer array … | |
Hello, I wonder what I need to do to use find() from <algorithm> to search in a vector containing some Struct, with two string vars. I'm not asking for codes now, I just want the principles. I written this, and got compilation error. [CODE=cpp] #include <iostream> #include <algorithm> #include <string> … | |
i need to know how to make a string variable in C++ i need to hold the file path of the desktop on a variable. in vb.net it would be like this: dim path as string = "path\to\desktop" | |
I'm trying GUI Library to see what fits me. I want to try GTK+ too. But I don't know where to start. At GTK+ site I took a look at C++ bindings [url]http://www.gtkmm.org/[/url] and found * glibmm 2.20 (stable) * gtkmm 2.16 (stable) * libgnomecanvasmm (stable) * gconfmm (stable) * … | |
Hi all, i was wondering if anybody could help me with this issue. I am trying to create an update tool within c++ which checks the download webpage file to see if it has been updated since the last recorded date. My problem is that i have no idea where … | |
hi guys, i've been battling with this program for too long now... i cant seem to get it to compile. i believe the problem lies in my use of objects being passed to different classes as parameters. (i will do my best to only paste code that i believe is … | |
I have a file format for storing text of any sort. It's a file format from a company, so I can't change it. Basically, in the beginning of the file, a series of "string starts on char#", "string length equals" values determines the "address" where a string starts and how … | |
I'm new to C++ and I'd like to start correctly. But I need to know what are the best practices for code sharing, like: _ use [ICODE] int void (main) [/ICODE] instead of other statements; _ use standard libraries when possible; _ what are the naming conventions for C++? I've … | |
I use this command to check for the Computername wich returns: [code] SystemInformation::ComputerName->ToString(); //returns: MYCOMP-EG03R8F [/code] When manually rightclicking "My Computer" and check what name I have, it says with lowcase letters: [B]mycomp-eg03r8f[/B] So it doesn´t return the correct name. It shows Capitals. But if I do this command instead: … | |
I want to make an input stream parser capable of handling input in any of the following forms: [code] x y z x,y,z x, y, z (x,y,z) (x, y, z) [/code] Is there a clever way to do this? Or do I have to check the first character, if it … | |
Hi guys/gals, ive been reading alot about bots and i kinda like the idea of creating one. can these bots be created in any programming language or does it depend on what i want the bot to do? ive probably posted in the wrong forum, sorry cheers Darren | |
how can i convert a hex value of a byte (unsigned char) to a short value? [code="c++"] unsigned char hexByte = 0x02; short value= ??? [/code] thank you for your help! | |
good time people I have a code like the one below: [code=c++] #include <vector> #include <stdio.h> #include "mymath.h" using namespace std; int main(){ int n; char a='y'; do{ cout<<"\n----------------------------------------\n"; cout<<"Enter a number for prime factorization : "; cin>>n; cout<<"\n----------------------------------------\n"; int *result=pfact(n); for(int i;result[i][0]!=0;++i){ if(result[i+1][0]!=0) cout<<result[i][0]<<"^"<<result[i][1]<<"*"; else cout<<result[i][0]<<"^"<<result[i][1]<<"=";} cout<<n; cout<<"\n----------------------------------------\n"; cout<<"Do … | |
Is it possible to indicate that a class function you are calling is static? [code] class Point { std::string name; public: Point(){} static void DisplayName() { std::cout << "Point" << std::endl;} }; int main() { Point.DisplayName(); //this doesn't indicate the the member function is static //maybe something like this: //static_call(Point.DisplayName()); … | |
hey I am currently working on a Fraction program and the fraction needs to be in lowest terms i have been working on this for a while and I can't figure out what is wrong with it i think i have been looking at it for too long, but anyways … | |
hi, i'm having problems with my homework. I have to create a Base classes from which 2 classes have to be derived, then i have to write a program to test their function. The problem that i'm having is that i'm taking the input from the keyboard and passing it … | |
So this is a small part of a bigger project I'm working on. I'm having trouble with having a visual countdown starting from a value the user inputs. I have three elements on the form textBox1 where the user enters the value to start from and label1 where the visual … | |
[code=c++] void func(char*,int&);//A function returning no value and taking a char and reference to int as arguments. typedef void (*PTR)(char*,int&);//A pointer to function returning no value and taking a char and reference to int as arguments. void Func2(PTR);//A Function taking such a pointer as argument. PTR Func3();//A Function returning such … | |
[COLOR="green"]Hi, does anyone know of a good tutorial for converting 'Ogg' files to 'AVI', I'm using MS VC++ 2008; MFC GUI classes preferred, but i'm still interested in 'Command Line Apps'; I am not using Linux, strictly WinXP. thanks[/COLOR] ;) | |
Hey, I've been trying to understand what the hell I'm doing wrong with this code. At the beginning, I include the DDRAW.H, and the code compiles with no problem, but as soon as I try using a function from that header, I get a linker error. The function I used … | |
[CODE]Suppose that a stack s and a queue q of characters are initially empty. Show s and q after each iteration of the second for loop of the following code fragment: for(char ch = 'A'; ch <= 'H'; ch++) s.Push(ch); for(int i = 1; i <= 4; i++) { s.Pop(); … | |
Problems 1. Results for height and weight output fine but I am trying to have gender change the following boolean assignment statements. 2 different results for height and weight base on either female or male. exp. males height is [COLOR="Red"](height >= 62 && height <= 78)[/COLOR] but for the female … | |
I have a problem about std::vector as member of class, I'm not clearly about the initialization mechanism [CODE=c++]#include <iostream> #include <vector> using namespace std; class Obj; //this is a Class object class Grid { public: Grid( ) { } ~Grid( ){ } protected: private: vector<Obj> v1; //initialization mechanism ? and … | |
Hi I have a question. [COLOR="Red"]The aswer is very short [/COLOR]I think. I got many different useful helps in different forums but [COLOR="Green"]still[/COLOR] my main question is [COLOR="green"]not answered clearly[/COLOR]! MY QUESTION: Can a [COLOR="Green"]not inline[/COLOR] [COLOR="Red"]method[/COLOR] have [COLOR="Red"]internal linkage[/COLOR]? This question is simple & clear (if you don't think … | |
ok, I have a very serious somewhat simple problem that I just can't seem to figure out myself. Simply put I want to make a program take the lines Hello How Are You ToDay and output ToDay Are You How Hello Using the End of data marker as a newline … | |
hi guys, new to c++ here. So we have a school project due tomorrow, a hangman game of sort and i just wanted to go a bit above the required so i thought i would put in a message box. Now i got the working and all but the thing … |
The End.