49,757 Topics

Member Avatar for
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
121
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
111
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
120
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
156
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
66
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
88
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
123
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
142
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
96
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
138
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
85
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
143
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
81
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
80
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
77
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
219
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
229
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
92
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
84
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
740
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
161
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
94
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
222
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
119
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
93
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
104
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
88
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
106

The End.