49,761 Topics
| |
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, … | |
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 … | |
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 … | |
[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? | |
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. … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
can someone pls post some tutorials or articles on "how to use mschart for plotting xy graph in vc++". thanks in advance :) | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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"; } … | |
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) { … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 ? | |
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 … | |
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 … |
The End.