49,761 Topics

Member Avatar for
Member Avatar for nhatphongtran

Hi! I'm still new to C++ programming and I'm currently writing a plugin for a visual-effects application. I create a point, which is generated by the member function of a different class. Here is an excerpt of my source code [CODE]void create_geometry(Scene& scene, GeometryList& out) { out.add_primitive(obj, new Point(Point::SPHERE, 300.0f, …

Member Avatar for Clinton Portis
0
82
Member Avatar for Silvershaft

I got a plenty of free time now and interested in GUI developement, I got expirience in C++, thats not the problem. I've done apps in wxWidgets before which I got bored to. Would it be learning to learn winApi or do you guys got better suggestions, as I said …

Member Avatar for William Hemsworth
0
154
Member Avatar for Carrots

Hi, I've been learning C++ these last few months, but never tried to make a GUI before. I've wrote a program in C++ which works via the command line, but now I'm trying to create a GUI for it (MFC using Visual Studio 2005, XP host). When I add an …

Member Avatar for Carrots
0
137
Member Avatar for kapil.muni1020

[code] void main() { static int a[]={ 0,1,2,3,4}; // if here static removed that hence error why? int *p[]={ a,a+1,a+2,a+3,a+4}; int **ptr=p; clrscr(); printf(" base address is %u",a); ptr++; getch(); } [/code] in above code in "staic int a[] " line integer array define as static why it need?

Member Avatar for Ancient Dragon
0
108
Member Avatar for thisismyuname

Hallo All, I am a beginner in C++ and currently need help in finishing the following task: I need to write an UDP code(C++) which sends and receives a random number (between 0 to 100). On the receiver's side there must be an User Interface showing the number received graphically. …

0
66
Member Avatar for HelloMe

Hello again :) I had this project (first block of codes below) and out of this program i have to do the same again but this time using functions. My problem now is, i made some functions ( i hope these are functions) but on the last part (the one …

Member Avatar for HelloMe
0
79
Member Avatar for fjrivash

Dear all, is there is a way to go trough a matrix using just one "for" loop?, I mean I have this snippet: [CODE] #define WIDTH 5 #define HEIGHT 3 int mat [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { mat[n*WIDTH+m]=(n+1)*(m+1); } return 0; …

Member Avatar for fjrivash
0
86
Member Avatar for Nikhar

Hey guys...Can you please help me explain what does returning an istream object mean. I am currently studying Accelerated C++ and at many places a function returns istream object. What does it mean? For example:- [CODE]istream& read(istream& is, Student_info& s) { // read and store the student's name and midterm …

Member Avatar for Nikhar
0
2K
Member Avatar for Afupi

My project requires I use the right-hand method of solving a maze. I have to use a stack to keep track of and eventually print out the path to the exit. I know the way I am trying to keep track of each point is wrong because using mazeArray[xCoord][yCoord] is …

Member Avatar for Afupi
0
225
Member Avatar for edherbs135

Just wondering if there was any kinda way of doing this kind of filtering based on comparison other than having to go through each position in an array one by one comparing it to every position in the other array. If I'm to vague and you need more information let …

Member Avatar for edherbs135
0
81
Member Avatar for Lukezzz

If you would convert these 3 examples to a string you would get an errormessage as no of the numbers are valid numbers. How would it be possible to do a check programatically if the number is a valid number before a conversion ? [code] String^ GetValue = ""; GetValue …

Member Avatar for fjrivash
0
136
Member Avatar for prakashmishra84

hi guys.. i need ur help badly . i need to implement the following project in c++, using oracle 9i as backend. but i dnt have any clue .. whr to start frm and how. please suggest me a possible lay out for this requirement. and i have also an …

Member Avatar for vyas lal yadav
0
144
Member Avatar for dumrat

I declared this inside one function: [CODE] void function() { .... static const int iLimit = GetLimit(); int iL = a_MyArray[iLimit]; .... } [/CODE] The code compiles ok in g++. What I want to know is whether the GetLimit function will be called only once (At the first call to …

Member Avatar for dumrat
0
92
Member Avatar for HelloMe

Hello everyone... I have a problem on the last part of my codes. This programm supposed to accept several kind of courses and its corresponding grades. So far so good... but when it comes to display the courses and the grades and its remarks of passed or failed, the programm …

Member Avatar for Seten
0
123
Member Avatar for sush27

can someone pls post some tutorials or articles on "how to use mschart for plotting xy graph in vc++". thanks in advance :)

Member Avatar for kvprajapati
0
70
Member Avatar for samsons17

Hi....I got a simple question here which i dont know how to solve... [B]Question[/B] Type casting is common in writing programs. It converts from one data type to another, for example from integer to double or float. Write a complete C++ program which uses casting, which will ask the quantity …

Member Avatar for jonsca
0
150
Member Avatar for Doughnuts

Hi everybody, I have a problem with output files. I have installed Code::Blocks and MinGW, replacing my old Borland compiler. I am trying to make a program that uses arrays and files: [CODE]#include <iostream> #include <fstream.h> #include <conio.h> #include <string> #include <stdlib.h> #include <cassert> using namespace std; void Save(ofstream& f, …

Member Avatar for bamcclur
1
112
Member Avatar for ShadowScripter

Hey, throwing a quick question in here: Is there a way to get the value at a cursor's location? For instance, the cursor is at {0,20} and I decide to do cout<<"Foo" then I move my cursor to {0,10} do something else and then come back to {0,20}, and I …

Member Avatar for technology
0
2K
Member Avatar for devo_99

I have been working on this program to count the number of zero's odd, and even numbers that a user inputs. I have tried different variations and cannot get it to go, I keep getting linker errors and cannot see where the problem is. I am new to this and …

Member Avatar for devo_99
0
183
Member Avatar for PDB1982

I'm working on a program where I need to input a file with 5 candidates names and votes, and output the name, votes, and the percentage of total votes that candidate received, as well as the overall winner. Right now I've been able to create some arrays and output the …

Member Avatar for jonsca
0
132
Member Avatar for sexyzebra19

Hi all, For have implemented a program that performs the bisection method, currently with the user entering the initial interval to find one root. However I was wondering if I could get the program to find the intervals automatically without the users input. The only way I can think to …

Member Avatar for jonsca
0
91
Member Avatar for Frap

Hi while doing my homeworks, i stucked here .. Writting a program to calculate the factorial of positive integer . here is my code: [CODE] int main () { int x,factorial; cout<<"Enter an integer to calculate its factorial: "; cin>>x; if (x==1 && x==0) { cout<<"\nThe facotrial is: 1"; } …

Member Avatar for donaldw
0
98
Member Avatar for itzaaron

why is only my first class working? when i run this it just asks about the viruses and not the cost of the OS. [CODE]#include <iostream> using namespace std; class OperatingSystem { private: float cost; public: OperatingSystem() : cost(0) {} float getCost() { return cost; } void setCost(float cost) { …

Member Avatar for GrubSchumi
0
85
Member Avatar for astroshark

Hi I manage to create some code to where it will read in a set of exam scores and display their category as well as if they enter an invalid number it repeats the code until the data is valid or until they enter the SENTINEL value but when I …

Member Avatar for astroshark
0
94
Member Avatar for PDB1982

How do I make an array to find the largest portion of another array? I am trying to find the candidate that received the largest amount of votes from the following file: Johnson 5000 Miller 4000 Duffy 6000 Robinson 2500 Ashtony 1800 here is my code: [code] #include <iostream> #include …

Member Avatar for Clinton Portis
0
129
Member Avatar for big_guy_bri

We are working on a header file for a template class called TreeNode. My class definition is as follows: [CODE]#include <iostream> using namespace std; template <class T> class BSTree; class TreeNode<T>; { friend classBSTree<T>; public: //constructor TreeNode( T = T(), TreeNode<T>* = 0, TreeNode<T>* = 0 ); private: T data; …

Member Avatar for Narue
0
104
Member Avatar for Trekker182

Hello everyone, I'm trying my hand at the strategy design pattern. I've got most of my code working, however, I keep running into two errors "invalid use of undefined type `struct sortStrategy' " strategy->sort(students); "forward declaration of `struct sortStrategy' " strategy = s;} I did a google search on both …

Member Avatar for Trekker182
0
144
Member Avatar for Darth Vader

I wonder if there is any function that returns the difference in minutes for examples like this: 1300-1515 (135 minutes) 2350-0100 (70 minutes) Is there any timefunction that can have the ability to return the minutedifference ?

Member Avatar for Excizted
0
83
Member Avatar for T-Dogg3030

Part of the assignment I'm working on is to display random letters between my good letters to encode text. Right now I can make it display random numbers. How can I change this to out put random letters? [CODE] #include <iostream> #include <fstream> #include <ctype.h> #include <ctime> #include <cstdlib> #include …

Member Avatar for mrnutty
0
287
Member Avatar for T-Dogg3030

I am trying to do a command line switch with an if statement. The problem I am running into is when I am using a letter, it wont recognize it. When I use a number, no problem. I think there are a few different ways to solve this. Can anyone …

Member Avatar for programmersbook
0
98

The End.