51,593 Topics
![]() | |
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. … | |
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. … | |
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! … | |
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 … | |
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. | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
Whats the difference between: pp = malloc(m*sizeof(int)) <--- I understand this and pp = **int malloc (m*sizeof(int)) <--- but not this ? | |
The Function double *solve( double a[ ][N], double b[ ]) what does the pointer notation * represent in front of solve? | |
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 … | |
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); … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … ![]() | |
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. … | |
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 … | |
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 … | |
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 … | |
i am new to c++ graphics.can anyone suggest a book name to study graphics for a beginner | |
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 … | |
Hello there, do you have any idea what is the corresponding function of this Win32 api (GetDiskFreeSpace) in standard library? Thanks. :) | |
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. … | |
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] … | |
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! … | |
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 … | |
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 <= … | |
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 … | |
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 … | |
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. … | |
[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 … | |
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 … | |
how can we do "make" and "makefile" in VC++ should I download the GCC compiler to windows | |
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 … | |
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 … | |
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 … | |
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 … | |
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"); … | |
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 … |
The End.