51,593 Topics

Member Avatar for
Member Avatar for frogboy77

Hey there. Just beginning to learn c++ on my own(not easy). Please fogive my lack of knowledge. I have a list of large numbers(50 digits) that i copied. I want to split them into an integer array of size [100][50]. I dont want to have to go through and put …

Member Avatar for frogboy77
0
128
Member Avatar for jwebb

Hello, I'm trying to create a program to calculate the factorial of variable int input. I am using xcode, and it's giving me an error saying "factorial was not declared in this scope" on the line within the else statement. I have found other programs on the internet, but I …

Member Avatar for jwebb
0
676
Member Avatar for sfuo

Hey guys I have come up with a solution for the problem I have but I would like to know how I could do this the way I initially had it set up but without the leak of course. vec3f.h [CODE]class vec3f { public: GLfloat _x, _y, _z; vec3f(){}; vec3f( …

Member Avatar for mike_2000_17
0
158
Member Avatar for prince26121991

[CODE]Memory of a variable or object automatically terminated of finish at the end of program than why we use destructor?[/CODE]

Member Avatar for Lusiphur
0
3K
Member Avatar for Rez11

When reading out of a textbook, is it good practice to write your code while looking at examples in the book? Is there any tips or advice someone can give when it comes to learning C++ from a book?

Member Avatar for denguru4
0
117
Member Avatar for cgcgames

I give up hehe. been looking over the form and the internet and couldnt find anything that worked. what i want to do is simple. i have made a program that uses a MDI form (basicly a shell form that opens forms in it). and in the menu bar it …

Member Avatar for cgcgames
0
81
Member Avatar for daviddoria

I posted a while back about how to overload << It seems all the examples online have the second argument as const, ie [code] ostream & operator << (ostream &output, const Point &p); [/code] but if I have a member function that simply returns a double [code] double Point::getX() { …

Member Avatar for daviddoria
0
196
Member Avatar for sana_moi

hellow; im working on visual studio c++ express ediion 2010 when i chose a win32 project i can include any dll as wont and it's work without a problem but when i chose clr application windows form and i include for exempl sql.h i had this error pleas help me …

Member Avatar for safe2010
0
245
Member Avatar for Silvershaft

Hey, this might be a stupid question, but I just looked into the code of one thing which I can't tell what it is, but you get the idea here: [code] static ChatCommand unbanCommandTable[] = { { "ip", 'm', &ChatHandler::HandleIPUnBanCommand, "Deletes an address from the IP ban table: <address>", NULL, …

Member Avatar for mike_2000_17
0
97
Member Avatar for camcam08

im using dev c++ my problem is how to create a notepad when i run the program.. ex. i input a name.. and then it will create a notepad in my document and the name of the .txt file is the name what i input. thx in advance.

Member Avatar for helpme87
0
202
Member Avatar for Benjaminsen

Hi everyone This is my first post here, so sorry if I break the etiquette of the forum. Anyway I am a founder in a small Danish company producing tools and services that help developers build better games. Historically we have focused primarily on flash due to the ease of …

Member Avatar for Benjaminsen
1
342
Member Avatar for mitchneys

hello help me...i need to create a parse tree with this source code: #include <iostream.h> int main() { int x,y; double ave; cout<<"Enter first number"; cin>>x; cout<<"Enter second number"; cin>>y; ave=(x+y)/2; cout<<"The average is"<<ave; return 0; }

0
64
Member Avatar for plizz

I think that I misunderstood something about class definitions in c++... Why it is legal to define class in multiple files, like this: file Test.cpp: [CODE]#include <iostream> using namespace std; void testFunc(); class A { public: void printText(); } clA; void A::printText() { cout << "file: Test.cpp, class: A, method: …

Member Avatar for mike_2000_17
0
277
Member Avatar for hanvyj

I am trying to make a dll but I am coming up with the following error: \Debug\VideoCapture2.dll.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. I set up my project according to [URL="http://msdn.microsoft.com/en-us/library/ms235636(VS.80).aspx"]msdn[/URL] using visual studio 2008. I looked for …

Member Avatar for hanvyj
0
604
Member Avatar for c12345n

I have a solution with many projects (assembled sepparetely), all works fine, but I want merge all because i want make only one project (I want it more secure without reflection to make obfuscation process). In process of integration anything appear not be assigned correctly. - I want run unified …

Member Avatar for Venjense
0
176
Member Avatar for gutiarfanatic7

I'm trying to write a blackjack game, but I ran into a problem with random integers. I'm to the point where the player has there original number, and they've chosen to hit. I need help figuring out how to make random_integer keep it's value, but then add another random integer …

Member Avatar for sfuo
0
151
Member Avatar for Ultratermi

Hey, is there a way to recognize the click on the "Show Desktop" button? Can be in C#, too. Thanks :D

Member Avatar for daviddoria
0
71
Member Avatar for trippinz

[code] { private PrivateFontCollection MyFonts = new PrivateFontCollection(); private Font messageTextFont; [/code] [code] public Form1() { InitializeComponent(); // get the message text font byte[] fontResource = XboxLiveBioCreator.Properties.Resources.ConvectionRegular1; GCHandle fontHandle = GCHandle.Alloc(fontResource, GCHandleType.Pinned); MyFonts.AddMemoryFont(fontHandle.AddrOfPinnedObject(), fontResource.Length); fontHandle.Free(); messageTextFont = new Font(MyFonts.Families[0], 9F, FontStyle.Regular); button1.Font = messageTextFont; //other code here } [/code] My …

Member Avatar for trippinz
0
244
Member Avatar for lilfish08

I am fairly new to c++ and have been working on this problem and asked the professor for help, but he has really been non-compliant. I am lost on this and keep gettin error messages that I do not understand how to fix. Any help that could be given would …

Member Avatar for lilfish08
0
209
Member Avatar for lilfish08

Hi I am having trouble with this program, because if the user inputs a multiple word answer for the second question, it will only display the first word of the given answer. And I tried using getline(cin, answer) instead, but that just did not even ask me for an answer …

Member Avatar for lilfish08
0
174
Member Avatar for imthiyas92

PLS HELP ME TO CODE THE MAGNETIC FIELD AT A POINT FROM A CIRCULAR CURRENT LOOP BY BIOT-SAVART LAW.PLS HELP NEED TO SUBMIT COMPUTER PROJECT WILL DUE TOMMORROW PLSSSSS HERE IS CODE BY MY OWN WAY #include <iostream> #include <conio.h> #include <stdlib.h> #define M 4*3.14*10^-7 main() { float B,N,I,R; cout<<"Enter …

Member Avatar for mike_2000_17
-1
874
Member Avatar for PixelExchange

Hello everyone. I have seen in quite a few programs, a menu that is actually scrollable. Not a scroll-bar (that can be implemented on a window via the WS_HSCROLL|ES_AUTOHSCROLL flags) but a scroller menu. The menu I am reffering to is often seen inside of windows folders, where the menu …

Member Avatar for PixelExchange
0
104
Member Avatar for trippinz

I embedded a font to my winform application and the font showed up on my computer as well as many others. But for some wierd reason it shows up as blank buttons (I used the font on buttons) on some peoples computers. It is not the OS they use as …

Member Avatar for trippinz
1
279
Member Avatar for saransh60

[code] #include <iostream> using namespace std; using std::cerr; using std::cout; using std::endl; #include <sstream> #include <string> #include <fstream> using std::ifstream; #include <cstdlib> // for exit function // This program reads values from the file '1.txt' // and echoes them to the display until a negative value // is read. int …

Member Avatar for Ancient Dragon
0
169
Member Avatar for Petitcharatonyo

Hello World! I'm new in the forum and I don't have too much experience with C++, I'm looking for help with my code, I hope you could help me :) I have to read from a file.txt different collumns, each of them corresponds to a parameter and store them in …

Member Avatar for sfuo
0
583
Member Avatar for rombo

I'm doing a Win32 video application and I've started with the SimplePlay sample of last Windows SDK v7.0. When I want to release the video and display a picture through an WM_KEYDOWN event the last video frame remains until an WM_SIZE or an WM_MOVE event is received. Namely, I have …

0
37
Member Avatar for xavier666

Here is a very simple code demonstrating how 'protected' is used [CODE]# include <iostream> using namespace std; class A { protected : int a; }; class B : public A { public : void f_1() // * { a = 10; cout << a; } }; int main() { B …

Member Avatar for Fbody
0
115
Member Avatar for miskeen

Hi, I’ve 3 classes : A, B and C. The class A includes an object from the class B and another object from the class C. In my class B, I’ve a function that returns a vector of struct. This function is called in the class A and after that …

Member Avatar for harris21
0
10K
Member Avatar for gaurav_13191

Hi, I have the following code which compiles absolutely fine.. [CODE] using namespace std; #include<iostream> #include<stdio.h> #include<conio.h> struct node { int data; struct node *link; }; void add(struct node **,int); void display(struct node*); int count(struct node *); int main(void) { struct node *p; p=NULL; add(&p,5); add(&p,1); add(&p,6); add(&p,4); add(&p,7); display(p); …

Member Avatar for arkoenig
0
111
Member Avatar for Fbody

I have seen in a couple of places that strstream objects are deprecated, but there are also stringstream objects. My compiler has 2 headers <strstream> and <sstream> and I don't know which is which. In light of this, which header should I use to produce more modern code? I suspect …

Member Avatar for Fbody
-1
159
Member Avatar for saransh60

[code] #include <iostream> using namespace std; using std::cerr; using std::cout; using std::endl; #include <sstream> #include <string> #include <fstream> using std::ifstream; #include <cstdlib> int main() { ifstream indata; // indata is like cin char num; int sar,ri,sat,ha; sar=0;ri=0;sat=0;ha=0; char s[]=".txt"; for(int some_int=1;some_int<=3;some_int++){ ostringstream buffer; buffer <<some_int; string s1 =buffer.str(); s1+=s; indata.open(s1.c_str()); …

Member Avatar for saransh60
0
199
Member Avatar for Panarchy

Hello! I've been learning how to code C++, but entirely Console apps! Can you tell me how I can convert Console apps into GUI apps? [Only using libraries built into Dev-C++ {yes, I know it's a pain!}] Thanks in advance, Panarchy

Member Avatar for Ancient Dragon
0
103
Member Avatar for catdieselpow

using namespace std; int main() { vector<double> row(3, 0); vector<vector<double> > table(3, row); printVectorOfVector(table); Fill in a 2 dimension 3x3 array with odd numbers. The display shows the array as it is being filled. Use random integers to fill the array. Use numbers between 1 and 10. Initialize array to …

Member Avatar for nana121
0
127
Member Avatar for miturian

So, due to my last question, [url]http://www.daniweb.com/forums/thread303487.html[/url], I am becoming acquainted with the vector template. However, I clearly am not using the commands correctly. Below is a section of code which, eventually, leads to a segmentation fault later in the program. First an introduction of the variables: [CODE] using namespace …

Member Avatar for arkoenig
0
186
Member Avatar for ziarczak

Hello everyone, I'm having problems with this code: [CODE=cpp] #include <vector> using namespace std; template <class Type> class Some { private: vector<Type> elements; vector<Type>::size_type index; //THIS IS WRONG public: Some() { } }; int main() { } [/CODE] It doesn't compile, giving me [CODE] p.cpp:9: error: type ‘std::vector<Type, std::allocator<_Tp1> >’ …

Member Avatar for Luther von Wulf
0
93
Member Avatar for furtaker

Hi, I am trying to incorporate a struct and class in the same program to calculate overtime pay and hours for one person. I am having a hard time with these two and especially putting them together. I am not sure what to do to get the program to compile …

Member Avatar for Luther von Wulf
0
249
Member Avatar for hanvyj

I have a problem casting a long to an int in c++ There is a long "biWidth" in the &pVideoInfoHeader->bmiHeader struct, I simply want to read this into an integer value "Width" [CODE=c]//check the video info header Width=(int)(&pVideoInfoHeader->bmiHeader.biWidth); Height=(int)(&pVideoInfoHeader->bmiHeader.biHeight); //break point here [/CODE] When I step through the code to …

Member Avatar for Stefano Mtangoo
0
5K
Member Avatar for loushou

okay i have an array of a struct. [CODE]struct MYSTRUCT { float myFirstVal, mySecondVal, myThirdVal; unsigned char myByte; } int myCountFunction(MYSTRUCT *&myArrayOfStructs) { int myCount; // question area return myCount; } [/CODE] here is my question. how do i count the number of elements in an array of type blah …

Member Avatar for daviddoria
0
139
Member Avatar for ithelp

Hi C++ experts, I am looking for a script which given a structure made of basic types can generate a C++ class which encapsulate the structure and it also generates the stream in and stream out method for the structure e.g [code] input int a ; char b; string c; …

Member Avatar for mike_2000_17
0
134
Member Avatar for danny.chungie

#include <iostream> #include <cctype> #include <fstream> #include <cstring> #include "ass1.h" using namespace std; const int MAXSIZE = 100; int records = 0; char Menu(); void ReadFile(); void DisplayRecs(); void AddRecord(); void SearchArray(); struct StudentRec { string Number; string GName; string FName; string subjects[4]; int results[4]; int numsubs; }; StudentRec StudentArray[MAXSIZE]; …

Member Avatar for ithelp
-1
152
Member Avatar for farooqaaa

How to pass an array of struct as a function parameter? This is not working: [CODE] struct Person { char* name; int age; Person(char* name, int age) { this->name = name; this->age = age; } } struct XYZ { int count; Person* people[]; XYZ(int count, Person* people[]) { this->count = …

Member Avatar for farooqaaa
0
260
Member Avatar for elsiekins

Hi, I have two Pthreads and two named semaphores, the semaphores are created within the threads, is there a way in which i can declare a semaphore in one thread and then open and use it in the other one ? Thanks

Member Avatar for elsiekins
0
295
Member Avatar for server_crash

I may not be understanding private inheritance right, but I thought when you inherited privately that you could still access public member data/functions, but the child class of the derived class would not. For some reason it is saying the public print() method is not accessable in this context....Is there …

Member Avatar for brkurre
0
223
Member Avatar for xheavenlyx

Before I ask the question I realize that selection of a programming language depends on the context of a problem at hand. Related to this I would like to know (if anyone) how many of you use which language for programming microcontrollers, embedded systems and even generally on PC. Here …

Member Avatar for stevephillips
0
218
Member Avatar for AdventGamer

I'm currently working on a program with linked lists. The program asks you to enter five integers, and every time you enter one that integer is added to the front of the list. My issue is that for each input, i need to insert the node at the beginning of …

Member Avatar for AdventGamer
0
119
Member Avatar for rcplguy15

Write a C++ program that takes 2 characters (c and d), and a positive integer (n) and outputs the following drawing of size n  n made of the characters c and d, as shown below: Enter two characters and an integer: # _ 6 #_#_#_ _#_#_# #_#_#_ _#_#_# #_#_#_ …

Member Avatar for sfuo
0
135
Member Avatar for vishal456
Member Avatar for glamourhits

HII ... i was doing this program where i can enter student grades and the program will tell me like the over-roll grade .. and stuff .. i am almost done i think but i am stuck now soo plz if u can make this work plz help .. THANK …

Member Avatar for Anyzen
0
181
Member Avatar for furtaker

I am trying to edit this program to pass two variables to the function call using a passing-by-reference. I need help as to how to modify what I have. Any help would be appreciated. #include "stdafx.h" #include <iostream> using std::cout; using std::endl; int incr10(int& num); // Declare function int main(void) …

Member Avatar for furtaker
0
458
Member Avatar for bobbuilder67

Hello everybody, I am trying to communicate with a Vitamin Scanner from a computer, which connects via Comm port. It should do the equivalent thing of opening up 'Hyper Terminal', typing in 'a', hitting enter, then typing in '?I', enter, 'S', enter, and a long list of integers shows up …

Member Avatar for sarah_10
0
2K

The End.