51,592 Topics

Member Avatar for
Member Avatar for Skeen

So I'm working on this OpenGL 3D Graph program, and like, I ran into some trouble, since I wanted it to support fullscreen, so I made the following; [CODE] int main(int argc, char *argv[]) { ... // Some stuff glutSpecialFunc(SpecKey); ... // More stuff } [/CODE] Which is calling the …

Member Avatar for Skeen
0
1K
Member Avatar for UKmason

I cant figure out how to make a function that correctly solves the max height of a parabola I know height = distance * tan(angle) - (gravity * distance^2) /2 *( speed * cos(angle))^2 I try to put this in and I get like 1.2 trillion I think im doing …

Member Avatar for Skeen
0
301
Member Avatar for rino699

The screen clean very fast cant see it move... how can make it looks btr? [CODE] int i,j,k,a; char logo[9][59]; for(a=0;a<59;a++) { logo[0][a]=262; logo[8][a]=262;} for(a=0;a<59;a++) { logo[1][a]=' '; logo[7][a]=' ';} strcpy(logo[2]," @@@@@ @ @@@@ @@@@ @@@@ @@@@ @@@@@ @@@@@ @ @ "); strcpy(logo[3]," @ @ @ @ @ @ @ …

Member Avatar for Skeen
0
102
Member Avatar for narendra.shah

hey frnds here...... i need some help..... i need a project in database or networking...... in c++/.net/java please help.....any effort will be highly obliged.....

Member Avatar for ithelp
-2
94
Member Avatar for dylank

Hi, there are several threads on this issue, but none seem to give me a good answer. My current code is this (This program plots points on a graph) : [CODE] //Put line equasion into arrays. #include <iostream> using namespace std; double getData(int counter, double m, double b) { int …

Member Avatar for invisal
0
1K
Member Avatar for Niner710

Hi, I have a simple question on trying to set shared ptr to NULL. I get an error(binary '=': no operator found which takes a right hand operand of type 'int') when I do this... [code] typedef std::tr1::shared_ptr<A> A_smrt; A_smrt = NULL; [/code] Why is this wrong?

Member Avatar for abhi_elementx
0
105
Member Avatar for BenJammin89

This program is suppose to display MPG's (total), and the combined MPG of all the total MPG's you input. [code] // Exercise 4. 12: ex04_12.cpp #include <iostream> using namespace std; int main() { double mpg; double gallons; double combinedMpg = 1; double total; while ( mpg != -1 ) { …

Member Avatar for BenJammin89
0
129
Member Avatar for qwertymk

this is what I made for a = operator: [code] matrix matrix::operator= (double a[]) { for (int i = 0; i < rows * clms; i++){ //std::cout << i<< "=" <<a[i] << " "; *(x +i) = a[i]; //std::cout << i<< "=" <<x[i] << " "; } return *this; } …

Member Avatar for qwertymk
0
123
Member Avatar for sgw

In the following very simple program, if the input is [I]not [/I]an integer (e.g. a character symbol), then the output screen would flash and go away. Is there a way to have the output "bad" when one enters a non-integer, just as when one enters a negative number? Thanks in …

Member Avatar for sgw
0
254
Member Avatar for Brandon515

hey guys, ok here's the situation. i need to turn a C++ style string into an integer now i've used altoi and strtol but they give me different numbers. heres my code [CODE] cout << file << endl << file.c_str() << endl; // debugging purposes num = strtol(file.c_str(), &pEnd, 10); …

Member Avatar for Brandon515
0
132
Member Avatar for blackst0rm

I am using Visual C++ Express Edition. I have 3 files: (A) main.cpp, (B) prototypes.h (C) implementation.cpp. main.cpp includes prototypes.h and prototypes.h includes implementation.cpp. When I go to "Start without debugging" things screw up because in (C) implementation.cpp the compiler complains that it can't find the data fields. e.g. it's …

Member Avatar for Ancient Dragon
0
264
Member Avatar for suganthan901307

[code=c++]#include<iostream.h> #include<conio.h> void main() { int x[5]={1,2,3,4,5},y[5]={5,4,3,2,1},result [5]={0,0,0,0,0}; int i=0; while(i++ <5) result[i]=x[i]-y[i]; clrscr(); cout<<"\nThe contents of the array are :\n"; i=0; do { cout<<'\t'<<x[i]<<'\t'<<y[i]<<'\t'<<result [i]<<"\n"; i++; }while(i<5); getch(); }[/code] OUTPUT: The contents of the array are: 1 -1 0 2 4 -2 3 3 0 4 2 2 5 …

Member Avatar for Ancient Dragon
-5
120
Member Avatar for jsmarts

my assignment is to make a triangel like so: * ** *** **** ***** I have done so but cannot get my command window to stay open. It pops up and closes right back out. heres my code can anyone help? #include <iostream> int drawBar(int); int main() { std::cout << …

Member Avatar for Shinedevil
0
151
Member Avatar for djnstuff

Okay, what I'm trying to do here is set up a some-what simple battle system for a text based game... I'm having some trouble getting it to work correctly though. I want the Player's attack and the Monster's defense to be random each time the program loops (which is also …

Member Avatar for Shinedevil
0
323
Member Avatar for restrictment

Hello, I am trying to make an rpg, and I am having troubles with functions. I am currently working on the 'potion' aspect of my rpg, which I have highlighted in red. My question is this: Is it possible to make the function return money, potion number, potion size, etc? …

Member Avatar for restrictment
0
374
Member Avatar for kadji.kahn

I'm trying to make a program that will read two txt files, with GPA information (one for females and one for males) arranged like this: M 4.0 M 3.7 M 2.9 I've been instructed to used pass by reference void functions with no global variables. My major issue is how …

Member Avatar for kadji.kahn
0
174
Member Avatar for Shaitan00

My system has a service (Serv.exe) which starts as LocalSystem and should be running at all time, additionally on startup of the PC (auto logon) the user has a STARTUP application (App.exe) which runs. Sadly I've found that sometimes App.exe starts to run before Serv.exe has finished starting, and one …

0
112
Member Avatar for skarocks47

So i am just starting out learning C ++ and i was trying to make a BMI calculator. When ever i run the program and it prints the BMI number its a weird number. Not one it should get. Please can u help me out with my source? #include <iostream> …

Member Avatar for jonsca
0
194
Member Avatar for asxoliastos

Hello I am new to this forum so be patient.. I am currently having an issue with a map iterator well the code i am talking about: [CODE] leafnode<LeafEntry<recno_t> ,blocknum,char*,recno_t>* descend(Object<dimensionality,Type>& ob,nonleafnode<NonLeafEntry<dimensionality,Type>,dimensionality,Type>* rt,blocknum* leafblocknum){ std::map< int,NonLeafEntry<dimensionality,Type>* >* entries; std::map< int,NonLeafEntry<dimensionality,Type>* >::iterator it; leafnode<LeafEntry<recno_t> ,blocknum,char*,recno_t>* L; int i,elements; if(rt == NULL) …

Member Avatar for asxoliastos
0
134
Member Avatar for tararengan

hello, I am interested in implementing the push relabel max flow algorithm in C++. I see an implementation at [url]http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/push_relabel_max_flow.html[/url] and don;t understand a good bit of it. I am in a position to describe my graph and if someone could explain how I can use this piece of code, …

0
87
Member Avatar for rkulp

I am trying to overload the Comparison Operators, to have them compare the RMR of two fitness trackers. I need to change the RMR from a double to an int for the comparison. How would I do this when the RMR is calculated by a function. Here is my code. …

0
115
Member Avatar for AdRock

I have a string which i can break down into tokens but what i want it to do is if it reaches a '//' it breaks out of the loop so no more tokens are added I have tried using this but it doesn't work [CODE]while (p!=NULL) { if(p=="//") { …

Member Avatar for AdRock
0
177
Member Avatar for xfreebornx

How can i sort this array pls.. [CODE]#include<iostream> #include<algorithm> using namespace std; int prompt(int x[]); void printreverse(int x[]); int main() { int x[5]; prompt(x); printreverse(x); system("pause"); return 0; } int prompt(int x[]) { for(int i=0;i<5;i++) { cout <<"Enter integers:"; cin >>x[i]; } } void printreverse(int x[]) { for(int i=0;i<5;i++) { …

Member Avatar for mrnutty
0
115
Member Avatar for teddyg18

So i am writing a simple prgm in which you enter the values of 2 matrices and multiplies them. [code] #include<iostream> #include<iomanip> #include<cmath> using namespace std; int main() { int i, j , k , l, m , n , o, p; cout<<"Enter The Rows And Cloumns And Of The …

Member Avatar for asxoliastos
0
126
Member Avatar for RonW56

Can someone help me with this problem I've been trying to do an else statement but it doesn't work here is the code.... for(int c=0;c<student_max;c++){ if(search_id==id[c]){ location=binary_search(id,student_max,search_id); cout<<"Student ID \tTotal \tGrade"<<endl; cout<<"-----------------------------"<<endl; cout<<search_id<<" \t\t"<<total[location]<<" \t"<<determine_grade(total[location])<<endl; //break; } //} else{ cout<<"Incorrect id entered"<<endl; break; } } }

Member Avatar for boblied
0
119
Member Avatar for rookanga

my assignment says to "Finish the header block on the function. " What is the header block? Is it the // (write information) or is it something else?

Member Avatar for Fbody
0
125
Member Avatar for isabellegagnier

I need to create a triangle in C++ that will take the user inputted letter (capital) and then create a triangle that will look like. I can only use nested loops NO arrays or strings Enter a letter: F F FE FED FEDC FEDCB FEDCBA here is the code i …

Member Avatar for isabellegagnier
0
234
Member Avatar for gtrippleb

I'm trying to write a c++ program that first asks how may people are in a party, then it takes that number to calculate how many times to ask what the next person wants to order. This is what I have so far. I can get the program to recognize …

Member Avatar for gtrippleb
0
117
Member Avatar for discovery-power

Hi All, I am trying to write a small program to better understand and practise writing blocks of code, I have written the one below but get the error message : "Linker Error undefined reference to WinMain@16 ld returned 1 exit status" // This program demonstrates a block of code …

Member Avatar for Fbody
0
131
Member Avatar for gedas

Hi everyone, Well I come to a point that I have run out of ideas and time and I’m going to ask for help from anyone that can help. I hope that there will be someone that could give me a hint how to solve my problem. About my problem …

0
93
Member Avatar for abraham james

May somebody pliz help explain to me line by line of this c++ coding cause I can't seem to understand it:- #include <stdio.h> #include <stdlib.h> #define SIZE 50 #define pi 3.14 void push(int i); int pop(void); void sort(int stack[SIZE],int numbers); int *pointer, stack[SIZE],numbers; void main(void) { int value,numbers,num,num2,num3,num4,array[5],num6,num7,num8; float num5,num9; …

Member Avatar for William Hemsworth
0
215
Member Avatar for Kaotic07

Hello, I have to write a program that merges 2 seperate files and then outputs to a single file. Each input file is to have numbers in ascending order and the output is supposed to compare these and then put them in ascending order. ex.: input1 = 1 3 5 …

Member Avatar for Kaotic07
0
155
Member Avatar for nalasimbha

I have the following struct [CODE]struct A { int a, *b, *c, *d; };[/CODE] I would be creating an array of A and then populating the member variable for each of struct in the array. The members b,c,d are allocated dynamically based on the value of A.a. To assign the …

Member Avatar for VernonDozier
0
111
Member Avatar for guguman

Hi guys, Sorry to ask a question as my first post. I'm totally new with c++ and I couldn't understand much about vectors. [CODE] case 1: { cout<<"Enter [S]avings Account , [C]hecking Account,[G]eneral Account"<<endl; cin>>selection; if ((selection == 'G') || (selection == 'g')) { acc.push_back(newAccount); cout<<"New account added"<<flush<<endl; break; }//end …

Member Avatar for SVR
0
141
Member Avatar for Excizted

Hi. I have a problem I cant find a solution to, since I am unable to describe the problem in a searchable way. I make a hWnd for each contact the user has: [CODE=C++]contact[atoi(rowC[0])].hWnd = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG4), hWnd, messengerBox);[/CODE] messengerBox is defined like this. [CODE=C++]BOOL CALLBACK messengerBox(HWND hWnd, UINT message, …

Member Avatar for Excizted
0
432
Member Avatar for UKmason

[CODE]double distance (double angle, int mps, double earth_gravity) { double earth_distance; double speed_sqr = mps * mps; earth_distance = speed_sqr * sin(2*angle) / earth_gravity; return earth_distance; }[/CODE] its supposed to come out at = 3831.57 intead it ends up being =3155.52 anyone know what im doing wrong?

Member Avatar for Fbody
0
271
Member Avatar for discovery-power

Hi All, I have just started learning how to write C++, I have written my very first very simple program using notepad and saved the file as simple.cpp. So my question is how do I compile or build my program into an executable file, I understand I have to use …

Member Avatar for discovery-power
0
161
Member Avatar for discovery-power

Hi All, I am currently learning C++ and i have started to write some small programs that explain operators, integers and values, my question is this. How do I make my programs stay on screen, at the moment I run my program it displays the message on screen for about …

Member Avatar for discovery-power
0
165
Member Avatar for Raghusys

I have been told to write a c or c++ program for TCP server client program with some conditions that is listed below: You are to implement a synchronization server managing barriers. Your synchronization server should be a stand-alone single threaded process that continuously awaits requests from other processes (the …

0
74
Member Avatar for sibobo

im newbies in c++... my task is to translate code Morse into alphabet an count the word i use... the problem is i dont know how to use the ifstream to read and use the code Morse that must be kept in .text file i only manage to write the …

Member Avatar for sibobo
0
166
Member Avatar for mevkurray

Hi all. Before you all scream "search the forum", i already have, this and many others. cant seem to find the problem with my code. Basically, i have a fairly large text file, each line consisting of 20 fields seperated by a `. i have got my program to split …

Member Avatar for mevkurray
1
1K
Member Avatar for just4why

I would like to automatically generated staff number before generated the staff number i would like to check the staff.txt is the staff number exist. If exist then it will get the last's staff number and continue to adding. But the code that i creating it wont work. Please help …

Member Avatar for just4why
0
112
Member Avatar for amar singh

[code]#include<stdio.h> #include<conio.h> main() { int a,i,fact=1; clrscr(); printf("Enter a number "); scanf("%d",&a); for(i=1;i<=a;i++) { fact=fact*i; } printf("Fact of %d is %d",fact,a); getch(); }[/code]

-1
68
Member Avatar for arpit.mishra

Hi, I tried to direct the output from a thread into a log file using fstream, but it dosent seem to work. If I use ostream then it works fine. Can you please let me know why fstream is not working. Thanks in advance

1
246
Member Avatar for punchinello

Here's the code: [CODE]#include<iostream.h> int test(); int main() { cout<<test(); return 0; } int test() { int a=1; a==1? return 1: return 0; }[/CODE] Could anyone please help me by telling me why VC++ 6.0 rejects this piece of programming code? Is the line" a==1? return 1: return 0;" grammatically …

Member Avatar for mrnutty
0
131
Member Avatar for freddyvf
Member Avatar for mrnutty
0
74
Member Avatar for punchinello

As I was told, recursion is a good way to make things simple in terms of writing programming code, but the outcome usually involves extra overheads. I was also told that for some recursion algorithms it is possible to adapt them to make corresponding nonrecursion ones. I wonder if there's …

Member Avatar for punchinello
0
84
Member Avatar for restrictment
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> using namespace std; int main() { //delcare varialbe char selection; //declare function void counting_loop(); void impossible(); void missing_item(); void odd_even(); void poem(); void pause_m(void); do { cout << " Welcome to the Fun Program" << endl; cout << " Select from the menu " << endl ; cout …

Member Avatar for VernonDozier
0
114
Member Avatar for samsons17

i'm trying to determine the age of the people by entering their id card number..i'm trying to do this without having the database.. is this code possible??because i got error when try to run it.. if this possible,could you tell me the correct way to do this? Thanks... [CODE] #include …

Member Avatar for jonsca
0
108

The End.