Beginners - November 2011 (Page 41)

Problem constructing a string/char array
 
Hi, I am new to C++. I'm trying to reverse a word input, but I've done something wrong, and it is not couted correctly. It can, however, cout each character, ...
[4 replies] Last: Ah, you're right about the indexing. I should have caught that. It s... (by Obesogen)
Pass byreference
 
I'm trying to learn pass byreference. I was wondering if someone could explain how to do this properly. #include <iostream> #include<string> using namespace s...
[5 replies] Last: oh, lol, simple enough. stupid mistake, thanks for pointing this out. ... (by InterFiction)
Can't figure it out
 
Hey, I have been around this exercise for hours and the book it comes on has no solutions so I'd be very greatefull if anyone could solve it for me and explain ...
[5 replies] Last: It is a one to one function. If you line up the cards by suit and rank... (by Duthomhas)
2d array problem
 
I've recently made an array for a tictactoe program, but then when I compiled it, it gave me this strange output, like this here: 003AFAC0 and this here: 001...
[2 replies] Last: thank's a bundle! I new it would be something stupid that I forgot... ... (by GaiusBaltar)
Only 2 inputs?
 
While running the program, my Dev C compiler will only let me input the first two statements, the third <"Enter the number of cable boxes:"> in just skips and e...
[2 replies] Last: I see what I did, thanks. (by jesse1221)
Console closing down in Vs 2008
 
Hello the following code does not stay open even with normal conventions of halting the cmd. Any suggestions? #include <iostream> #include <string> #inc...
[14 replies] Last: THANK YOU DEAR GOD or Branflakes91093. Thanks it works now. (by closed account 9L8T0pDG)
Easy question? Need help understanding overloading assignment operator
 
It seems to me that the standard definition for an overloaded assignment operator is something along these lines: Vehicle& operator =(const Vehicle& rhs); ...
[1 reply] : Yes. Also: a=b=c; (by helios)
Left shift and registers
 
Hello! I have found this peice of code and i dont know what it does... can anyone please briefly explain what this does to variable x? What becomes of it...
[1 reply] : First it gives x a hex value, which in base 10 is 65280. In binary th... (by ascii)
How to select string?
 
So if i have several strings and want to select one to display, how do i do that? (code below) #include <iostream> #include <fstream> using namespace std; ...
[3 replies] Last: Oh, come on, people. It's just a switch statement (or if-else chain) t... (by Albatross)
Undefined reference to constructor, using generics
 
I can't get it to work, but I don't see what I'm doing differently from the examples given in my textbook. Can anyone explain? set.h #ifndef SET_H #defi...
[3 replies] Last: Thanks for the help, guys. (by Marquis)
Including new lines in string input
 
I'm writing a program that deblanks an input. example "This is a sentence." becomes "Thisisasenctence." I am scanning in the characters one at a time...
[no replies]
by Steyr
Hunting down the reason for a crash...
 
Hi everyone! this is my first post on cplusplus.com. I'm having some difficulty hunting down an error in the following code. It compiles fine, but when it runs ...
[4 replies] Last: Ah, I see now. *(scoreset + x) = *(scoreset + i); should have been ... (by Steyr)
Class/Vector memory question
 
Hi all I have this program for class that involves creating an array of classes. For some reason i get an "Access violation reading location 0xddddddd1.". Th...
[2 replies] Last: Thanks for replying Line 8 is there because I read the file in anothe... (by v3loc1ty)
by Peyton
Memory Leak
 
Hi, Below is a link to a portion of code where there is apparently a memory leak. http://img585.imageshack.us/img585/1769/leakw.png The code is from a...
[5 replies] Last: I think that virtual has a different meaning when applied to destru... (by Catfish)
by Chakra
Passing and Receiving Values to VBScript
 
I am attempting to call a .vbs file, passing a single argument (a string), and getting the result. I am simply failing on all sorts of levels. What I want to ...
[no replies]
by Jarr10
code help
 
What will the output of the following code be if A is true, B is false and C is false at the time these lines are executed? if(A&&C)cout<<"Do this\"; els...
[1 reply] : Why do you ask? This looks strangely like homework, which I'm sure y... (by Ben Duncan)
simple array question
 
I've taken a step back to learn a few more basics, as I'm having trouble with certain things. Right now I'm just messing with a simple array. I'm getting some s...
[8 replies] Last: Let me clear up the for for you. for (int i=0; i < 100; ++i) { ... (by Catfish)
by Jarr10
Code output
 
Can anyone tell me what this code outputs? int main() { int test=10; do { cout<<-test<<endl; } while (test->4) return(0); }
[3 replies] Last: I think you've got the code wrong. It should be: #include <iostream... (by Moschops)
Strange Pointer syntax
 
Could somebody please explain these lines of code as I do not understand the output on the console... int *l = (int*)1000; cout << l << endl; ...this pri...
[3 replies] Last: It just happens to output the hex value by default; when dealing with ... (by Moschops)
by DizzyD
Primary Expression C++
 
#include <iostream> using namespace std; int main() { int age = 0; cout<<"Please input your age: " <<endl; cin>> age; cin.ignore(); if ...
[1 reply] : Your problem on lines 15 and 18 is the same, you have forgotten to put... (by lpop010)
November 2011 Pages: 1... 3940414243... 65
  Archived months: [oct2011] [dec2011]

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