49,757 Topics

Member Avatar for
Member Avatar for losh177

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 …

Member Avatar for losh177
0
117
Member Avatar for ganmo

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

Member Avatar for ganmo
0
227
Member Avatar for sacarias40

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"

Member Avatar for Narue
0
76
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
242
Member Avatar for seao111

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 …

Member Avatar for Salem
0
149
Member Avatar for khenz

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 …

Member Avatar for ArkM
0
134
Member Avatar for QuintellaRosa

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 …

Member Avatar for ArkM
0
248
Member Avatar for QuintellaRosa

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 …

Member Avatar for Ancient Dragon
0
78
Member Avatar for Liszt

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

Member Avatar for Liszt
0
207
Member Avatar for daviddoria

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 …

Member Avatar for ArkM
0
83
Member Avatar for dazzclub

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

Member Avatar for siddhant3s
1
120
Member Avatar for dav555

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!

Member Avatar for dav555
0
281
Member Avatar for massivefermion

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 …

Member Avatar for iamthwee
0
142
Member Avatar for daviddoria

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

Member Avatar for siddhant3s
0
98
Member Avatar for goyofoyo

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 …

Member Avatar for goyofoyo
0
111
Member Avatar for losh177

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 …

Member Avatar for losh177
0
2K
Member Avatar for 215wrestler189

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 …

Member Avatar for Ancient Dragon
0
88
Member Avatar for Sky Diploma

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

Member Avatar for Dave Sinkula
0
139
Member Avatar for Slephnir

[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] ;)

Member Avatar for William Hemsworth
0
85
Member Avatar for ShadowScripter

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 …

Member Avatar for William Hemsworth
0
912
Member Avatar for blackhawk9876

[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(); …

Member Avatar for _Nestor
0
91
Member Avatar for DarkSaint

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 …

Member Avatar for DarkSaint
0
82
Member Avatar for newcpp

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 …

Member Avatar for newcpp
0
7K
Member Avatar for CppBuilder2006

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 …

Member Avatar for CppBuilder2006
0
325
Member Avatar for Aelphaeis

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 …

Member Avatar for Narue
0
285
Member Avatar for cruisx

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 …

Member Avatar for dubeyprateek
0
176
Member Avatar for Usura

it is possible to change the colour of the font in the terminal by using come sort of code, not sure of the correct term, what im after is like cout << "hello" << endl; and hello would be bold or a different colour, can that be done?

Member Avatar for dubeyprateek
0
103
Member Avatar for ShadowScripter

Greets, A string array in C++ can be initialized, just like everything else. With that in mind, how do you count the number of items in the array? I mean, how many rows? Let me give you an example using Char arrays (having two dimensional since it's not like string) …

Member Avatar for ShadowScripter
0
93
Member Avatar for Sam_Surrey

Hi guys, i have been having problems with this piece of code all afternoon, i have never seen this error myself before and cant see how the problem is applicable in my situation from looking though the various forums of the world ! Basically the program is a small game …

Member Avatar for Sam_Surrey
0
123
Member Avatar for gretty

Hi I have to create a program that takes in 2 arrays (each array containing 5 values). The program will check whether the 5 values of array one contains the same values of array 2. I have done everything to make this program work [B][I]except[/I][/B] ....[B]how write an algorithm that …

Member Avatar for siddhant3s
0
4K

The End.