General C++ Programming - May 2012 (Page 40)

memset,malloc,alloc
 
hi, Can anyone tell me the exact difference between memset,malloc and calloc.I am new to c++, Know this is simple question to ask in c++ but i am getting l...
[4 replies] Last: tks for ur reply guys.... (by sharath137)
Working with structures, arrays, and classes
 
These are my requirements. Create a class that simulates and manages a soft drink machine. Information on each drink type should be stored in a structure that ...
[3 replies] Last: Here is the header Drink.h // Class Drink implmentation code "Drink.... (by blairsaid)
Calendar Program that Ouputs Work Schedule
 
I am currently working on a program for my Object Oriented class. The task is to create a calendar (Which I have already done) and output the work schedule for ...
[no replies]
Purpose of size_t
 
Hi, I just found out C++ supports vectors which I guess are safer to use than dynamiically allocated memory for arrays, but what is size_t in the for loop, why ...
[2 replies] Last: size_t is the type returned by the sizeof operator, and it's what you'... (by Cubbi)
Purpose of size_t
 
Hi, I just found out C++ supports vectors which I guess are safer to use than dynamiically allocated memory for arrays, but what is size_t in the for loop, why ...
[2 replies] Last: 1) What's size_type? std::vector::size_type is a type that is defined... (by closed account 3hM2Nwbp)
Merge sort : which is the correct method?
 
I found two different implementations of merge sort. The first one, merges two sorted arrays into one single array. http://mathbits.com/mathbits/compsci/...
[1 reply] : The first one describes what is called a merge, which is an algorithm ... (by blueberry)
Default argument to virtual function.
 
Hey Guys Can someone please advise what the rule is regarding default arguments used in virtual functions? From the output of the code below, you can see the ...
[3 replies] Last: Thanks much guys. I understand now. (by rajatgirotra)
Help me connect my functions
 
How does the compiler choose which function to run first? If I choose not to Play, I want my main() to run. #include <iostream> #include <ctime> using namesp...
[8 replies] Last: tripline, the 2 solutions I use are to either 1) run the program with ... (by rollie)
Arrays Help
 
The Program objective is this: Write a program which will use 3 arrays. They will contain a students first name, last name, and Final grade average. Use a l...
[1 reply] : I think you are pretty close. First the assignment says you need 3 arr... (by buffbill)
by zik
generating random numbers
 
explanations and series of steps needed
[no replies]
wrong valors being passed
 
I have a program that simulates a heapsort, but it doesn't work when the size of the array is smaller than 4 or bigger than 9. Can somebody point me the proble...
[no replies]
valgrind shows definitely lost blocks in simple code
 
How can i remove memory leaks in simple code below? int main() { char* str = new char(); str = "test"; //delete str; return 0; } g...
[1 reply] : The leak occurs at line 3, where the only copy of the pointer to the d... (by Cubbi)
print string in reverse order with unknown length and without using libraries
 
Hi, Is it possible to print a string in reverse order without knowing length and without using string libraries? (just using pointers) void printReverse(char ...
[3 replies] Last: Thanks all :) (by kayseri)
Quantity reduction help
 
Hello all! I've stumbled into a problem while trying to complete this code. I can't seem to figure out how to reduce the number of drinks when the program purch...
[no replies]
Private class
 
Class B is derived from class A privately; can a public member of class A be accessed directly in class B?
[2 replies] Last: I think the answer is yes, but i am not sure why (by jag4205)
Unequal random
 
Hi. How to generate unequal probability random number. I mean i.e when I want to generate a number between 1 and 10, these numbers does not have equal probabi...
[8 replies] Last: Thank you Cubbi ;) (by majidkamali1370)
by ebru
acil yardım!
 
m tabanında verilen iki sayının çarpımı istenmektedir. Bu çarpımı tekrarlamalı (recursive) olarak yapan programı yazamadım yardımcı olur musunu...
[4 replies] Last: do you look for some thing like: int multiply(int a, int b){ if(b <=... (by therockon7throw)
need your urgent help c++ arrays
 
This question is mainly based on Block II – Unit 1 and it tests your ability to work with arrays. Consider a 5-by-5 array of characters. Write a C++ program ...
[3 replies] Last: @codekiddy: LOL!!!!!! (by viliml)
help pleaseee getline() is being skipped
 
I am working on a little program and for some reason when I try and use the getline() it is giving me a lot of problems here is what I did getline(cin, s....
[5 replies] Last: You have a different problem than the one described in the faq. You a... (by cire)
by lilrj9
Hello need help with this C++ program
 
So I am in need for two programs to be created. They are very simple, but I am very poor at C++ here is the questions write a program that declares and inte...
[5 replies] Last: 1. #include <iostream> #include <cstdlib> using namespace std; int ... (by viliml)
May 2012 Pages: 1... 38394041
  Archived months: [apr2012] [jun2012]

This is an archived page. To post a new message, go to the current page.