51,593 Topics

Member Avatar for
Member Avatar for mypopope

hi! smart people. It is my 11 days of reading and studying this book turbo c/c++, and I'm almost in the last part of the book. It is fun learning computer programming using c++. I'm having problem on how to apply the principles, that i've learned,so I need an example. …

Member Avatar for WaltP
0
241
Member Avatar for still_learning

I am looking to make a small program for a friend who likes to play roulette. I am looking to make a program that reads from a file which contains numbers (the numbers that come out in roulette) and then counts the amount of numbers that fall in certain groups. …

Member Avatar for tracethepath
0
109
Member Avatar for tom1989

Hi, i am having some trouble trying to finish my program! So far i have been able to load the data from a file into an array! Although now, what i cannot do is use this data. I cannot figure out how to use this data later in the program! …

Member Avatar for vmanes
0
92
Member Avatar for barbie 2

hi i am writing a program that counts words containing at least 3 different vowels using functions and also input files.i am confused here and don't know what to do.in this program i am to write another function that will output either 1 or 0 when a character is a …

Member Avatar for tostrinj
0
155
Member Avatar for Justmehere

I'm using Borland Command Line Compiler and want to use the regexp.h implementation of this header file. Where can I find all available functions and their definitions and maybe samples or examples of how they are used ? Thanks.

Member Avatar for Justmehere
0
129
Member Avatar for dabu

Hello. I wrote a program which works fine, all i need is to add one more thing. When I ask the user to input an answer (withdraw, balance...) I don't know how to prompt them if they enter something else, such as "golfball" and loop them back to entering the …

Member Avatar for Lerner
0
155
Member Avatar for blindkilla

Ok i have a file of names that looks like this: [code] john mary joe matthew [/code] im trying to use a for loop to store each name in a variable or string so i can use a for loop again later to output each name im pretty new to …

Member Avatar for WaltP
0
118
Member Avatar for dddave999

I would ultimately like to write my own OMR (Optical Mark Recognition) program. What language would you recommend is best to carry out this task.

Member Avatar for dddave999
0
335
Member Avatar for mister-fett

I decided to revive my (many months) inactive site today using things I've learned about C++ CGI and the Document Object Model along with CSS. The site is still down, but I'm trying to get back into CGI after leaving it alone for a while (also months). I've spent the …

Member Avatar for WaltP
0
435
Member Avatar for MedianHansen

Lately i've been having some problems, importing an SDL library, into my compiler, and as a result of that i have chosen to change to a new compiler. I have followed 3 differend online tutorials, re-installed the compiler three times, and done it with three different downloads of the SDL …

Member Avatar for people123
0
326
Member Avatar for weasel7711

I am working on a project to demonstrate the use of strings without using "strings" in the formal definition, as in using pointers to arrays of characters. The program is supposed to pick a string from an array of pointers to chars, but allow the program to include more words …

Member Avatar for weasel7711
0
2K
Member Avatar for cl3m0ns

I have a program that takes two separate arrays one of all the peoples names and the other of their test scores. I am not sure how to display the scores in a table view. here is my code so far [code=cplusplus] #include <iostream> #include <string> #include <math.h> using namespace …

Member Avatar for tracethepath
0
86
Member Avatar for zandiago

Good day. How do i convert the following code to C++? [code=java] // Lets import our file functions. import java.io.*; public class Grades { // Setup an array of test students private static Grades.test student[] = new Grades.test[50]; // Just for spunk we will create an inner class to keep …

Member Avatar for Ezzaral
0
180
Member Avatar for warpstar

Whats the difference between: pp = malloc(m*sizeof(int)) <--- I understand this and pp = **int malloc (m*sizeof(int)) <--- but not this ?

Member Avatar for Salem
0
159
Member Avatar for warpstar

The Function double *solve( double a[ ][N], double b[ ]) what does the pointer notation * represent in front of solve?

Member Avatar for Duoas
0
99
Member Avatar for SHWOO

I am trying to animate a bitmap in a window. I am able to load the bitmap in random locations multiple times, but I would like to have the previous instance of the bitmap erased each redraw, as I would like it to be a smoother animation instead of thousands …

Member Avatar for Duoas
0
240
Member Avatar for rugae

One function is pass by pointer which stores the reference, the other is just pass by a reference... are theses methods equvilent or does one method require more memory than the other? [code=c++]#include <iostream> using namespace std; void cubeByRef(int *num); void cubeByRef2(int &num); int main(){ int a = 2; cubeByRef(&a); …

Member Avatar for Ancient Dragon
0
125
Member Avatar for anga08628

Define a structure called Class with the following data: title (class title), units (number of units) and grade (letter grade received for the class). Define a structure called Student with the following data: name (for student name - can include spaces), gpa, and classes which is an array of Class …

Member Avatar for prushik
0
115
Member Avatar for prushik

So far i have gotten GetPixel() to do pretty much exactly what I want it to do inside of the client window. But, is there any way I can get the color of pixels outside the client window? Heres my current code: [CODE=C++] HDC hDC; PAINTSTRUCT ps; hDC = BeginPaint(hWnd, …

Member Avatar for prushik
0
122
Member Avatar for cl3m0ns

I have this program it allows the users to enter a name and a score it saves all the names to one array and all the scores to another. The program then displays all the names and scores in a list. I want to have the code for displaying the …

Member Avatar for WaltP
0
162
Member Avatar for lexo

I'm using Dev-C++ Basically, I have a text file with lines similiar to the following: [i] zSectionone olo loo ool ool zSectiontwo olo olo loo ool zSectionthree olo loo loo ool [/i] i need to read from the text file [i]stats.txt[/i] each line... when it hits a line beginning with …

Member Avatar for Ancient Dragon
0
67
Member Avatar for warpstar

Heres the problem, Ill try my best to explain this: If your given a 5x5 array whicih looks like: 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 Basically in each column below any …

Member Avatar for warpstar
0
90
Member Avatar for cl3m0ns

I have a program that takes two arrays. One is a persons name. the other is their test score and displays it. I have an if statement nested in the for loop used to fill the array that allows you to enter stop as a name and it will put …

Member Avatar for cl3m0ns
0
126
Member Avatar for cl3m0ns

I am trying to write a program with two separate arrays in it. In the first array I will store all my Dads clients names. In the second array I will store all their address. If I wanted to do this how would I go about storing the arrays so …

Member Avatar for twomers
0
146
Member Avatar for maomaowlw

Dear all, I'm just swtching c++ programming from windows to Mac os. I had a program using matlab engine, which worked well in windows. When I tried to built it using Eclipse with gcc, it reports linking problems as follows: **** Build of configuration Debug for project MatEng **** make …

0
98
Member Avatar for vijay_choudhari

I am getting coredump on linux (Red Hat 3.4.6-8). I am using gcc (GCC) 3.4.6 20060404 compiler. The problem is I have used a static map inside a function (making the map local to the function). This function is in libStreet.so Now at run time another host application is loading …

Member Avatar for iamthwee
0
140
Member Avatar for disc

Hi all, This is my problem: [code] void StartRun( void ) { std::auto_ptr<Validate> val ( new Validate( "input.txt" ) ); val->DoIt( ); } // Destructor Validate::~WValidate( ) { if( mFileIn.is_open()) { mFileIn.close(); } if( mFileOut.is_open() ) { mFileOut.flush(); mFileOut.close(); } } [/code] The function DoIt() makes use of a DLL. …

Member Avatar for WaltP
0
88
Member Avatar for clski1973

I am to use one loop to accumulate numbers (and later get average of) and to be a sentinal control (when the user wants to quit). I think it makes better sense to use 2 loops (nested) but the instructor has insisted on one loop. Could anyone give me a …

Member Avatar for WaltP
0
145
Member Avatar for tropical08

i got a little question hope you guys can help out i wanna copy a char array[8] to a 2D array , strcpy doesn't let me do it. how should i go about [INLINECODE] char letter[8]="abcdefg"; char temp[10][2]; for(int i=0;i<10;i++) strcpy(temp[i],letter[i]) [/INLINECODE] how do i get extract all the letters …

Member Avatar for tropical08
0
86
Member Avatar for aswinikg

HI I am a newbie to 'C' and embedded application . I have a code in which the input parameter is being assigned in two ways (i) Runtime through user (ii) parameter tile the problem is, i can't give the runtime input as am a in need of creating a …

Member Avatar for aswinikg
-1
82
Member Avatar for santhiks

i am new to c++ graphics.can anyone suggest a book name to study graphics for a beginner

Member Avatar for Xavier2k
0
79
Member Avatar for warpstar

Can someone please explain to me how dynamic memory allocation actually works? For example whast going on in the piece of code written below? If you can respond asap, that would be great. Thanks in advance. [code]p = (float *) malloc ( n * sizeof( float ));[/code] And whats the …

Member Avatar for Salem
0
221
Member Avatar for jaepi

Hello there, do you have any idea what is the corresponding function of this Win32 api (GetDiskFreeSpace) in standard library? Thanks. :)

Member Avatar for jaepi
0
236
Member Avatar for jordan1985

Anyone here can help me code a bubble sort algorithm code in C++ programming? I need to separate it in different file, which include the "h" file and the "cpp" file. The sorting display must be have 7 screen which the sorting is sort in step and show in step. …

Member Avatar for ndeniche
0
95
Member Avatar for pearly

morning everyone. i hope someone out there could really help me. im trying to store large numbers. as i need to complete my work under Dev-c++ environment but im not familiar with it as i just started using it recently. the following is my initial coding for my work. [code=cplusplus] …

Member Avatar for pearly
0
1K
Member Avatar for hellokitty88

I need some help figuring what I should do when I dynamically allocate memory to four instantces pointing to an animal class. After I allocate memory in the constructor, I must set it to "Lion", "Cat", "Dog", "Monkey". So far this is what I have written. Feedback would be great! …

Member Avatar for ithelp
0
91
Member Avatar for stokes323

I'm trying to write a program for a homework assignment and basically have no idea what to do now... if anyone could help me by pointing me in the right direction it would really help.... Write a C++ program that includes a function called "find_a()". This function will take a …

Member Avatar for Ancient Dragon
0
88
Member Avatar for Duki

Hey guys, I'm supposed to write a program that will calculate the Nth fibonacci number, without using recursion. I have the recursion problem written already, but am having a hard time doing the iterative one. here's my recursion function: [code]int fib ( int n ) { if ( n <= …

Member Avatar for Duki
0
759
Member Avatar for warpstar

Each of the following program segments might have syntax, logic or other kinds of errors. If there are errors, correct, otherwise answer "no error". Assume all function headers are correct. Function copy_array receives an integer array a and its size length, as parameters. It copies the array a into another …

Member Avatar for Ptolemy
0
165
Member Avatar for jonbuckets

Need to figure out what is going wrong with my source code. When I imput the values of 72, 69, and 2.8 respectively I should output pdf=0.85801, however I am not getting that value. I don't know why. I am doing the adaptive simpsons method to find the probability density …

Member Avatar for jonbuckets
0
96
Member Avatar for still_learning

This time I am making an orderedLinkedList program, which will not compile for me. The code is all way too long to put on here, so I will show you the errors I am getting. Please give me any input on what you think the errors could be caused by. …

Member Avatar for Duoas
0
223
Member Avatar for warpstar

[code] _ _ _ _ function2(_ _ _ _ _ _ _ _ _ _ _ ); main{ int n[]= {4, 5, 6}; int *kptr ; kptr = function2( n ) ; } [/code] Fill in the blanks and you get: [code]int *function2( int array[ ]); or int *function2( int …

Member Avatar for WaltP
0
121
Member Avatar for c++beginnerer

Hi, im at the end of my tether after spending hours trying to find a solution to this so hopefully somebody here can help me out. I have a structure, customer, which contains just a few details such as name address phone number etc. I need to store this info …

Member Avatar for Lerner
0
95
Member Avatar for rohit83.ken

how can we do "make" and "makefile" in VC++ should I download the GCC compiler to windows

Member Avatar for Ancient Dragon
0
105
Member Avatar for RohitSahni

Hi All, I am working on a situation suppose i am calling one exe(C++ code) from unix shell script now i want that 2 values in that unix script which this c++ code will get from some URL. Any Idea how can i get those 2 values from C++ code …

Member Avatar for Duoas
0
91
Member Avatar for garc2541

My assignment asked me to write a function that would print out a "*" when a number was prime. My output also has print out the odd numbers between 5 and 49. Anyway My function prints out only the prime number, while I want it to print out all the …

Member Avatar for WaltP
0
110
Member Avatar for Duki

Hey guys, we were given an opportunity for extra credit in my OOP class. We're going over recursion and my prof said if we could do a project using recursion and do another useing iterative statments, and time them, we would be given extra cred. Is there a way to …

Member Avatar for Duki
0
95
Member Avatar for warpstar

My Question is regarding the code written below. If you look at the function called "function" when 'a' is passed to the function and the function "function" is evaluated. I was wondering what the return value would be for the first pass when (a =2), my questin specifcaly is that …

Member Avatar for Ancient Dragon
0
110
Member Avatar for DejanL23

I tried to write a basic calculator program, Visual basic finds 1 error. I cant find it. Please help. I am kind off new to programming. [code=c++] #include <iostream> using namespace std; int main(void) { system("TITLE calculator"); system("COLOR 9"); char cChar; double dfirstnumber; double dsecondnumber; char cDoagain; do { system("CLS"); …

Member Avatar for DejanL23
0
178
Member Avatar for tonyaim83

My C++ program creates a nxn matrix with given value. For e.g if the input is 10 it will creates a matrix of 10x10 now what i want is the script should run program and give input values in a variation of 1000. Say first matrix of 1000 then 2000 …

Member Avatar for maddog39
0
74

The End.