Beginners - March 2011 (Page 31)

by ToniAz
Swapping pointers or Swapping Addresses?
 
Hello Everyone! I'm a bit lost, what's the difference between this sample I've just came across int a = 10; int b = 99; int * pa = &a; int * pb; p...
[1 reply] : Well, one has 9 lines of code, and yours has 3. Also, this int *pt ... (by hanst99)
while loop repeats 1 more time??
 
I would like to take this oppertunity to say hi to everyone. But I have a small problem I cant seem to work out. Its a simple dice program I created to try ...
[5 replies] Last: If you wonder why, the next character getchar eats is a '\n' for the e... (by hanst99)
Accessor Methods
 
Could someone clearly explain to me whats going on here in the code below: HINSTANCE GetInstance() { return m_hInstance; };
[3 replies] Last: [quote=tpOreilly]Well, we have a data type followed by a function??? ... (by guestgulkan)
Declare a variable
 
hello, i am a beginner with c++ i am trying to solve this problem Declare a variable x , suitable for storing values like 3.14159 and 6.02E23. so i ...
[4 replies] Last: well i guess so but trying to learn this on my own Don't do that. ... (by hanst99)
passing in blank ofstream
 
Hi, I have a tree and each node has an int, lf and rt ptr. I want to reuse traverse() so I can use it to delete and write the int to a file. Below is the co...
[5 replies] Last: It is best to do what ne555 did. It is good to group similar code, ... (by hamsterman)
Question as to what I need to be learning.
 
Hey im a computer science college student and I am trying to learn C++ on my own and I got a book off of amazon called beginning C++ through game programming. A...
[9 replies] Last: I see. Well thanks for the clear explanation - beforehand I wasn't eve... (by anonymous23323124)
input from a file
 
In writing a function I will use a lot, I am having trouble getting input from a file: string askfile(string question) { string a; string l...
[2 replies] Last: First glance, problem may be the lack of initialization of your strin... (by hanst99)
Strange behavior with global variables
 
while i was learning about global variables I did some trials and found one problem. Here goes my code. int cows = 10; //global variable void farm1() { ...
[1 reply] : An implementation detail. Your compiler may have optimized your code t... (by hanst99)
While passing the array to a function, shouldn't it be the same array which is passed?
 
Hello friends, I'm new to c/c++, so please forgive me if this is something stupid. I'm trying to simulate gets() functionality and got a doubt here. char* x...
[6 replies] Last: Thanks, I know the basics. I can very well follow OOP concepts and dat... (by subith86)
Why does this work?
 
I've been having trouble understanding for statements. So, playing around a little, I wanted to display a multi-dimensional array. It works, but there's somethi...
[3 replies] Last: Also, as an alternative to putting newline characters at the end of yo... (by packetpirate)
Integer variable
 
Given an integer variable strawsOnCamel , write a statement that uses the auto-increment operator to increase the value of that variable by 1. i wrote this...
[2 replies] Last: Hello i believe the increment is ++ ? :) am i right ? this is pretty ... (by Brooklyn)
school help(not homework, just ideas)
 
Hey guys I was wanting some extra credits for high school and also wanted to brush up with my programming skills. So I was wondering can you think of any c++ pr...
[10 replies] Last: I want to move on to DirectX later anyways so I may as well suck it up... (by bboy212)
Code will compile, but doesn't work correctly.
 
Here is the purpose of the program (I'm sure the "DayOfTheWeek" program has popped up here before): 1. Set the day. 2. Print the day. 3. Return the day....
[4 replies] Last: Thanks! Seems like all I needed was a better pair of eyes lol. (by itsadamyo)
Printing Binary Tree
 
I know how to print a balanced binary tree, I'm just not sure how to print a tree with index values. By index values I mean if I print a list, I want to say tha...
[2 replies] Last: *Bows to your greatness* Awesome. Thanks m4ster r0shi. I was doing so... (by thepedestrian)
Need help C++
 
Here is the question i would really appreciated if someone can provide me with code. thanks in advance. this is for C++: write a program that lets the user...
[4 replies] Last: not really i mean i don't know how write a code formula for monthly p... (by bukhang)
by Enuo
SIGSEGV at cin
 
I have a class project to build an icebreaker game. The project is done is pieces, at the moment three functions need to be implemented: create display and getL...
[8 replies] Last: fun2code: iceBorad lets me set up a table of arrays. ie. iceBoard boar... (by Enuo)
Arrays, pointers and functions question
 
Hello all, Below I have some code that I'm having trouble with. I make an array called myArray and initialise it with the integers from 1 to 10. I output thr...
[7 replies] Last: The STL classes (like vector, map etc) are very perfomant. Trust me, t... (by hanst99)
by ChrisC
Trouble sorting a dynamic array of dynamic arrays
 
Ok, so I've been working on this for a while and I feel stupid for having to ask, but I just can't see it. My sort function works, but it doesn't sort my dat...
[1 reply] : Hey Chris, i havent read all your code, but in void AMultiList::in... (by Mathes)
Parabola
 
Hi, first of all my name is Christoph and I am from Germany. So feel free to ask me if you can't understand me. Right now I am attending a programming cla...
[18 replies] Last: And why should I write still == '1' instead of still == 1 ? The compi... (by hanst99)
Question about return statements
 
So, I'm writing a text adventure, and in it I the user having an inventory. Now, instead of writing the same code every time the user wants to check their inven...
[18 replies] Last: instead of using std::cout; using std::cin; using std::endl; using s... (by bboy212)
March 2011 Pages: 1... 2930313233... 52
  Archived months: [feb2011] [apr2011]

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