Beginners - April 2011 (Page 30)

New and Delete with Deque
 
Would this work to delete the memory that I allocated of type object? class object; int main(){ deque <*object> mydeque; Object * ptr; ptr = new(...
[3 replies] Last: I see what your saying. I'll have to wait till I get home to mess play... (by Deftwun)
"While" loop generating same result every time
 
Afternoon all, I have a while loop in my program. It's a simplified Battleships game, and this is the part where you select a space to bomb. The computers' n...
[3 replies] Last: Thank you both very much :) I tried everything but that :P (by Jonnyisonfire)
by rach
dont know why its wrong
 
i did this c++ program and its not working and iam nt sure why..it would be great if i was told why?? #include <iostream> using namespace std; int main () ...
[3 replies] Last: thanks that help makes sense. (by rach)
Isosceles Triangle Nested For Loop HELP
 
Hello, I am just a beginner in programming, i'm just in my first year so i dont know many things in C++.. My professor gave us a project that will create an ...
[2 replies] Last: Since you're not allowed to move the console cursor backwards, you'll... (by m4ster r0shi)
Why: push_back?
 
I was just wondering, why it's better to use push_back, when adding elements to an array, rather than just doing something like: vec.x = 5 for example.
[7 replies] Last: If you're dealing with a fixed length array, the index operator is the... (by kbw)
by JessH
Passing array of object as a parameter
 
I'm getting quite confused with all this pointers, objects and arrays. Let's say I want to create a car array with 6 cars inside and then get those cars "paint...
[5 replies] Last: I solved this returning the whole array as a parameter like this: ... (by JessH)
binary conversions
 
I have a homework question here which asks me to convert a certain binary number (in twos complement) into a decimal number. Now the problem I'm having is the w...
[6 replies] Last: yes you must put log after the number.. because of that you can see in... (by RisteMK)
Counting Letters in a Text File
 
Hi all! I'm really stuck on this problem... I have to open a file stream "text" and count each time a letter occurs and print it out. For example, the file "...
[2 replies] Last: first you must have one ifstream variable, then one array of integer, ... (by RisteMK)
Could u check if i correctly answered these programs, just not sure if i answered question properly.
 
Write a C++ program that reads from keyboard 3 integers, with proper input prompt, and then displays the maximum sum of any pair of numbers from these three. ...
[2 replies] Last: Oh dam. Any hints on how i could fix problems 1 and 2? (by tjtilime)
by caneta
Multithreding without boost
 
Hi everybody. I need some tutorial/example of C++ multithreading without use of boost libraries. I know the portability problems I can encounter, but I'm ...
[3 replies] Last: Googleing a bit I saw that using POSIX threads in C++ is such a mess. ... (by caneta)
No matching function error.
 
Hi again all, having another issue with my program. Every time I try to read a value into an array which is a member of my structure I get a really odd error: n...
[2 replies] Last: Brilliant! Thanks a bunch matsom, it took a little tweaking but I've g... (by zdcoombs)
Help with Polynomial assignment
 
Hi everyone this is my first post on here because I am having trouble with an assignment in my second level C++ class. I have taken 2 C++ classes and have had t...
[17 replies] Last: You're welcome. I hope you can work off that example. I think you get ... (by closed account D80DSL3A)
by wlemay
solved
 
sorry, i cant find a delete thread button... i solved my issue
[2 replies] Last: There isn't a delete button, because there is no need of one http://ww... (by ne555)
desk checking!
 
hey guys, im coding for an assignment and have got my soloutions coded. What do they mean by desk checking and how can i do it? cheers. any feedback will be app...
[5 replies] Last: @Computergeek01 (1150), it all has to be submitted online in a zip so ... (by hakkenadlay)
2 dimensional array of random numbers
 
Hey all, I'm currently trying to write a code that will create an array of randomly generated numbers whose size is based on user input, the input has to be bet...
[4 replies] Last: I keep trying different varitions of the nested loop but I'm still onl... (by stykes06)
by gh0st
help with this problem
 
3. Daphne invests $100 at 10% simple interest. That is, every year, the investment earns 10% of the original investment, or $10 each and every year: interest = ...
[1 reply] : change cleo and daphne's type to float/double, lines 12 and 13 is mea... (by matsom)
A confusing array load.
 
Hi, this is my first post so plz forgive me for any confusion. I have a C++ program that is loading in a data file into an array. I believe I have a good unders...
[no replies]
Infinite loop upon opening file
 
Hey all, I'm having some problems reading in from a file. I'm attempting to use a file name that the user of the program types in, open it, and then read data f...
[4 replies] Last: Ah, thanks firedraco. Makes sense now. (by zdcoombs)
Multiple files
 
I am using dev c++ and the allegro library. Im makeing a simple game however i need to figure out how to make a program with multiple cpp files. So, how do i ...
[8 replies] Last: Apologies, I made a typo. I meant to say "source" file, as the OP said... (by Zhuge)
logical operators
 
I'm new with C++ and im having troubles with logical operators, my textbook doesnt explain it well so this might be completely wrong, although here are a few qu...
[4 replies] Last: thanks, think i got it now (by Sleepylessjk)
April 2011 Pages: 1... 2829303132... 55
  Archived months: [mar2011] [may2011]

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