51,593 Topics

Member Avatar for
Member Avatar for Mafia619

Hey, I've got an assignment from my computer teacher in school. I've got to make a program that displays the prime numbers in a range and also display the number of prime numbers that are present. And i'm only supposed to use the basic header files.....that means the program should …

Member Avatar for VernonDozier
0
313
Member Avatar for Stefano Mtangoo

Hi all, I have a question here :) Suppose I have a library in source code form (Let say [URL="http://tangentsoft.net/mysql++/"]mysql++[/URL]) and I have built it, and now I have the files (.h, .lib, .dll). How do I combine them in project? I use [URL="http://www.codeblocks.org"]code blocks[/URL] Why I ask? Because [URL="http://www.python.org"]Python[/URL] …

Member Avatar for Stefano Mtangoo
0
193
Member Avatar for Perham

Hi, I'm writing a class that controls Bitmap I/O. here's the working code: [CODE] #ifndef __linux__ #include <windows.h> #endif #include <stdio.h> // Our functions class FEN { int not_defined_yet; }; class fileBITMAP { public: BITMAPFILEHEADER file_header; BITMAPINFOHEADER info_header; RGBTRIPLE* image_data; fileBITMAP (int width, int height); int writetodisk(FILE* handle) { printf("writing …

Member Avatar for Intrade
0
107
Member Avatar for new programer

I need to enter 10 students names I did a loop but it does not work well [CODE]# include <iostream> # include <string> using namespace std; //functions prototype void avg (double& average); char grade(double& average); int main() { // String variable for the student's name string name; double theAverage = …

Member Avatar for jonsca
0
145
Member Avatar for denizen08

[CODE=C++]polynomial polynomial :: derivative(void) { polynomial outpoly; outpoly._coef = new double [_degree]; outpoly._degree = (_degree-1); for(int i=0; i<(_degree); i++) { outpoly._coef[i]=(i+1)*_coef[i+1]; } return outpoly; } //header: #pragma once #include <complex> #include <iostream> #include <string> #include <sstream> using namespace std; class polynomial { private: double * _coef; int _degree; public: // …

Member Avatar for Narue
1
170
Member Avatar for scriptkiddy

Hi, I heard that I can see how VC++ 6.0 converts my C++ code to assembly so I can rewrite it in assembly while removing useless junk. Could somebody tell me how this would be done? Well, guess ill just use ollydbg to see how my programs converted

Member Avatar for Ancient Dragon
0
231
Member Avatar for gogodr

I got it when trying to initialize my array of sprites (( the only one trowing me null is the sprite2D[] AllianceCharacters declaration: [CODE]sprite2D[] AllianceCharacters; static string Cardspath = Directory.GetCurrentDirectory() + "\\Content\\Cards"; string[] ActionBar = Directory.GetFiles(Cardspath + "\\ActionBar\\"); string[] Equips = Directory.GetFiles(Cardspath + "\\ActionBar\\Equips"); string[] CharactersAlliance = Directory.GetFiles(Cardspath + "\\Characters\\Alliance\\"); …

Member Avatar for Ravenheart
0
102
Member Avatar for nunchuckie

quick description: f(n)=n/2 if even f(n)=3*n+1 if odd with given start value it can step back and forth between the two eqtns. Example: f(7)=22, f(22)=11, f(11)=34, f(34)=17 You enter two start values. first and last start value and the program should generate all values in between. With a given max …

Member Avatar for mrnutty
0
153
Member Avatar for anbuninja

can anyone tell me why my output gives me - numbers? [code] #include <iostream> #include<iomanip> using namespace std; void getEmployeeData(int [ ], char [ ], int [ ], int); void displayEmployeeInfo (int [ ], char [ ], float [ ], int); float calculateGrossPay (char [ ], int [ ], float …

Member Avatar for jonsca
0
111
Member Avatar for turtlez

Hello, This is what i need: I have a php file on my website ([url]http://example_site.com/php_file.php[/url]) ((and no, that isn't the actual site)) And i have some C++ knowledge. Now how can i get C++ to send a variable (eg: name) to my php file. ((Client -> Server)) I have no …

Member Avatar for turtlez
0
116
Member Avatar for turtlez

Hello, i need help with a basic code issue, i ave posted the code [URL="http://turt2live.zxq.net/cpp/hoomin.html"]here[/URL] because it is too long to post... The issue occurs in this section of code: ...(more before) void getInput(int num){ char = one[1]; char = two[1]; char = three[1]; char = four[1]; ...(more after) saying …

Member Avatar for turtlez
1
123
Member Avatar for Gerard I MUFC

Hello everyone, pleased to be on the forum. I'm currently undertaking some game development in Visual Studio, in my spare time. I've been programming for a few months, in Java, and now am having a go at C#. I have however run into a little snag with lists. I'm trying …

Member Avatar for Gerard I MUFC
1
354
Member Avatar for Ahmad Shaheen

Write C++ program to do the following: • Define a Double Linked Lists EmpRank where the data should be of type integer. • Enter 10 Employee Ranks, where each rank should be inserted in EmpRank with respect to its value as ascending order its ordered • Print out the EmpRank …

Member Avatar for Clinton Portis
-1
153
Member Avatar for Dewey1040

So this is just the beginning of my questions, but I'm seriously having problems using classes in C++, I'm writing a program right now to plot points using asterisks on a 40 by 40 plain. right now I'm just trying to write the .h for the point class and i …

Member Avatar for sfuo
0
143
Member Avatar for kryz

I'm confused with pointers. I'm not sure how to get the vowels to show up in Case A. Also, I would need help by how to get the program to run again after case A instead of ending the program after each case. Should it be in if/else statement instead …

Member Avatar for Clinton Portis
0
789
Member Avatar for reese27

I have two vectors--one with the name of the class and one with the abbreviation of the class. The name of the class is in the same position of the abbreviation in the different vectors. I want to make it to where if I input "AERO" the output should be …

Member Avatar for Ancient Dragon
0
36
Member Avatar for Tales

I built a Visual Studio 2008 VC++ project, dialog based using HTML. In my HTML I have: [CODE] <form name="loadExcel"> Choose the file which contains the information:<br /> <input type="file" name="myFile" value="Search" id="myFileInput" /><br /> <input type="button" class="Upload" name="loadExcel" title="Import" id="loadExcelButton" /> </form> [/CODE] The user is supposed to browse …

Member Avatar for Tales
0
272
Member Avatar for kangekraam

I am trying to print the corresponding Unicode character for alt+2 to the Windows console window. (the console doesn't display the character, but should display ^B instead) The following doesn't seem to work. Just prints "2". keybd_event(VK_MENU,0 ,0 , 0); //Alt Press Sleep(10); keybd_event(VK_NUMPAD2,0, 0 , 0); // 2 Press …

Member Avatar for kangekraam
0
99
Member Avatar for bigmaq

So I am programming a heap sort and i am gettin pretty close to where i need to be, but I am having trouble in one of my functions when it heapifies my array. here is the code. [code] #include<iostream> using namespace std; class Heapsort { private: int *array; int …

0
76
Member Avatar for dchunt

Is there any language or way to write a program that is about 10000 lines in such a way that it can't be re-engineered by decompiling it ? What options are available to pursue ? Thank you for your time..

Member Avatar for kolosick.m188
0
110
Member Avatar for zephy2

Hello everyone, I have used the Vector2 Class which is implemented by my asst. , and I encountered a problem with initializing it. VS2008 kept saying I violate 0xC0000005 Error, and I counldn't find any reason for this. Is there anyone who can tell me what mistakes I have made? …

Member Avatar for twomers
0
486
Member Avatar for Jalwes

Hi all, I'm having a heck of a time with our latest assignment. I've tried everything I can possibly think if to make this work, but with no luck. We need to Load an inventory text file, sort it, search it(haven't even got to that portion of the code). I …

Member Avatar for Tales
0
142
Member Avatar for Fajer91

Hello everyone i'm a new member , i need ur help with this code , i want to write a for loop that assigns the 3rd row of the array to 0,, and then print out the array after setting the 3rd row to 0.

Member Avatar for rahul8590
1
123
Member Avatar for ab00120

Hi there, I am trying to make a program, as shown below. I have used a snippet with hello and bye as the program is really very big. Unfortunately I am unable to edit these functions as they are all part of a complex linked list. I am trying to …

Member Avatar for jonsca
0
96
Member Avatar for gsingh2011

I'm making a graph theory problem solver and basically I made a bunch of functions that will set up the graph and allow the user to modify the graph, but obviously these functions can only be called from the program. The user can't just type the function name and expect …

Member Avatar for rahul8590
0
140
Member Avatar for rahul.nutron

Hi, Its my first project. I have to develop a c program which can balance a chemical equation by the method of 'Generalized matrix inverse method for balancing chemical equation and their stability'. But I am using a little different method. where I am not able to find complete step …

Member Avatar for rahul8590
0
153
Member Avatar for llemes4011

The company that I work for just bought a Qt License, so we've been messing around with it. So far, it's really nice. I'm more of a Java guy, and it's made the transition from Java to C++ much easier. The only real problem I have with it now, is …

Member Avatar for rahul8590
0
86
Member Avatar for ankit_the_hawk

Hello every1 I was making this program of a phone directory to store contacts and all their information in C. I made use of structure and then copied the data of the structure to a file. the structure is [code] struct phdata { char name[20],add[20]; int phno; }ph[20]; [/code] the …

Member Avatar for aqtel003
0
221
Member Avatar for SDPRIYA

i have downloaded mhah library and i tried to include it in turbo c++ i copied the folder to the turbo c++ when i tried to run the c files in the library i found 5 errors cant able to include mutils/mincludes.h... mutils/mtypes.h... mutils/global.h... mutils/mhash.h... libdefs.h mutils folder is found …

Member Avatar for Ancient Dragon
0
336
Member Avatar for FanatiK

Hi, my name is Jonathan. I am 20 years old and I have just started getting into programming in the C++ language (you must get this alot). I do know a couple of programming languages already. Now before I waste your time let me just say that there is no …

Member Avatar for FanatiK
0
100
Member Avatar for pkuchaliya

hi to all, I have design a Application that takes input from the Web cam or other video devices. and have to add some frames in the Live video and then display. i have study out the direct sdk , which provide the flexible enviornment. but i dont get the …

Member Avatar for pkuchaliya
0
184
Member Avatar for pymatio

I'm creating a media player with Qt & the phonon module: [CODE] #include "mainwindow.h" #include "ui_mainwindow.h" #include <fstream> #include <string.h> #include <stdlib.h> #include <QtGui> void MainWindow::slotFinished(){ int index = sources.indexOf(mediaObject->currentSource()) + 1; mediaObject->enqueue(sources.at(index)); setLabelNowPlaying(); } std::string ExtractFilename( const std::string& path ) { return path.substr( path.find_last_of( '/' ) +1 ); } …

0
151
Member Avatar for ihtesham4deni

Problem Statement: File Handling in C/C++ On the basis of the given scenario create a file Expenses.txt, Open the file and copy into another Expenses2.txt, Also show output on screen A college has announced the total budget of 50,000Rs.for each game. Games are done four times in a year. Take …

Member Avatar for rahul8590
-1
260
Member Avatar for pspwxp fan

According the exercise, which makes us practice with vectors, i am supposed to write a program that allows the user to enter his/her favorite games, view them and remove any he likes. Obviously, to remove a piece of text, it has to be of the same case as the one …

Member Avatar for pspwxp fan
0
113
Member Avatar for drake2212

I am having an issue. I need to check whether the user enters a digit greater than 0. If so the user needs to be reprompted. If 23409932 is entered then the 0 entered should be caught and the proper messaage displayed. Here is my code and please somebody help. …

Member Avatar for rahul8590
0
90
Member Avatar for tomtetlaw

How do I load 3D meshes from a .x file, and extract the material data from it? Also, how do I apply a texture to the loaded mesh?

Member Avatar for tomtetlaw
0
183
Member Avatar for bestnone

i keeps getting error i going to break my head to solve this problem =.= what i am doing is using the a[3][3] to minus 128 but seem i get the problem in minus [CODE]#include <iostream> #include <iomanip> #include <cmath> #include <cstdlib> using namespace std; double shifted_block(double array[3][3]); int main …

Member Avatar for jonsca
0
141
Member Avatar for ms_farenheit1

I am working on writing a class to define an NxM matrix. A matrix should be printed in the form: [0 1 2] [3 4 5] [6 7 8] [CODE]private: //matrix class member variables unsigned int rows; unsigned int cols; float * data; // constructor matrix::matrix(int r, int c) { …

Member Avatar for Fajer91
0
110
Member Avatar for bamcclur

[CODE] //////////////////////// /////counter.h file///// //////////////////////// #ifndef _COUNTER_H #define _COUNTER_H class Counter{ private: int counter; int limit; static int nCounters; public: Counter(int arg, int arg); void increment(); void decrement(); int getValue(); static int getNCounters(); }; #include "counter.cpp" #endif ////////////////////////// /////counter.cpp file///// ////////////////////////// #include <string> #include "counter.h" Counter::Counter(int a, int b){ counter=a; …

Member Avatar for bamcclur
0
451
Member Avatar for johndoe444

Hi, The problem I am facing is that I don't understand the code mentioned in the following: [CODE]25: /******** this is the main thread's code */ 26: int main(int argc, char *argv[]) 27: { 28: int i; 29: int retvals[NTHREADS]; 30: 31: /* init retvals */ 32: for (i=0; i<NTHREADS; …

Member Avatar for bamcclur
0
168
Member Avatar for rafta

In this code I want to have a function to show average of movies saw by students, how to define and declare and call it in this program: [CODE]#include <iostream> #include <iomanip> using namespace std; /****************Function Prototypes******************/ void displayList(int [], int); //function to display array void getAverage (int [], int); …

Member Avatar for jonsca
0
86
Member Avatar for zemly

Plz help me. I am unable to understand this problem statement. Can Plz someone help me? [B]Problem Statement: File Handling in C/C++[/B] On the basis of the given scenario create a file Expenses.txt, Open the file and copy into another Expenses2.txt, Also show output on screen A college has announced …

Member Avatar for zemly
0
131
Member Avatar for tomtetlaw

How do I load 3D models that are in the .x format from DirectX 9? I am trying to make a simple engine and this is the part where I am stuck at.

Member Avatar for tomtetlaw
0
87
Member Avatar for new programer

Hello all, I did this program below, it is meant to get a student name then 5 of his/her grades sums them up in a void function and calculate the average but outputs the average from the main the problem is that the loop goes on and prints the prompt …

Member Avatar for ScottieF
0
168
Member Avatar for confusedndazed

My question: What is the output of the code corresponding to the following pseudocode? [code=text] Set y = 0 For (i = 0; i<=6; i=i+3) For (j = 0; j<=15; j=j+5) Set y = y + 1; End For (j) End For (i) Output y [/code] This is what I …

Member Avatar for rafta
1
124
Member Avatar for KRal

// I am new to C++ and can not seem to get the falling man to output to the screen. Any help would be greatly appreciated. [code] #include <iostream> #include <windows.h> using namespace std; void DrawBar(char guess); int main() { char solution[8]; //holds solution char blank[8]; //holds "*"'s for unsolved …

Member Avatar for KRal
0
186
Member Avatar for maverick405

I just want to know what does the below mentioned function means? [CODE][COLOR="Green"]void swap(char& a, char& b)[/COLOR][/CODE]

Member Avatar for mrnutty
0
78
Member Avatar for Ryujin89

I am probably well on the wrong path with this one which is why I can't get the program to compile in the slightest. The assignment instructions are : [quote]The Frozen Tongue Ice Cream Shop sells six flavors of ice cream: chocolate, vanilla, strawberry, mint, rocky road, and mocha. The …

Member Avatar for Ryujin89
0
148
Member Avatar for Deadmon

Hello all, I'm trying to parse a file, but for some reason, getline is combining my two letter words with other words. Here is the portion of code I'm working with: [B]note[/B]: my program will always ignore the first word in a line [CODE] char line[256]; string word; char *line2=new …

Member Avatar for sfuo
0
103
Member Avatar for rafta

here is my codes basicallysorting works but now i have to set a counter to display out the contents of array1 and array2 each pass of the sort. the problem is where to put that counter???? [CODE]#include <iostream> #include <iomanip> using namespace std; // Function prototypes void showArray1(int [], int); …

Member Avatar for rafta
0
269

The End.