Beginners - September 2011 (Page 16)

create a string by adding other string elements?
 
is there any possibility to add few elements of other string to get a new string? #include <iostream> #include <string.h> using namespace std; int main() { ...
[6 replies] Last: Basically it makes a string with no data. Technically, the only point... (by firedraco)
by citric
trying to figure out what's wrong
 
#include<iostream> using namespace std; int main() { int Va; int Vb; int A; int x; if(x = "+"); { A = Va + ...
[6 replies] Last: Thanks that did it. It finally works. (by citric)
Underscore variable naming convention?
 
_Value vs Value _Variable vs Variable ..etc What does this typically signify? From what I understand this convention is used to signify private variables c...
[4 replies] Last: From what I understand some times an underscore is used after the vari... (by drunken meerkat)
Random Numbers
 
Hi, I have used random numbers in several programs, such as blackjack, to create arrays of random integers, and I can easily generate them. However, when I try ...
[8 replies] Last: Thankyou, ultifinitus, GetTickCount() works great for me! (by alpharens)
Help with errors please
 
I am very new to c++ and am currently taking classes to learn the language. I am running into some errors when compiling and am not quite sure why. If anyone ha...
[3 replies] Last: Thank you Athar! That worked. (by keveneven03)
What is wrong with my while loop?
 
I have this project do tonight. I cannot figure out what is wrong with my program. My first prompt tells me to enter "ID" and when I do the while loops ends and...
[10 replies] Last: Forgot to mention this before, but in the future, please use [co de] ... (by Zhuge)
by JBabyJ
Newbie needing help
 
Good morning everyone! I am currently taking a computer programming and problem solving class. I have absolutely no previous programming experience, so I mig...
[5 replies] Last: What is with that space? Put a zero there as a placeholder and your an... (by Zhuge)
by smalld
why the following function template does not work
 
Anybody know why the following compile error occurs? #include <iostream> using namespace std; template <typename Any> void swap(Any & a, Any & b); i...
[2 replies] Last: Thanks, it works. (by smalld)
Help with class assignment
 
I need to write a program for my class that prompts a user to enter a bank account number and account balance. That part is easy and I got that done. The sec...
[1 reply] : It said the remainder, which you get via the modulus. So I would assum... (by Zhuge)
how would you write the function to skeleton in a file
 
If you have a class declaration for class X in a file X.h that includes the line void fun_x(int y). how would you write the function to skeleton in a file X.cpp...
[2 replies] Last: Thanks webJose. Could not find any info about skeleton (by firstsight1)
Read stream of numeric values
 
I have the following ASCII file (when something like 1176*0.00 is found it means 1176 zero values) 1176*0.00 633.82 473.29 427.05 53*0.00 495.94 431.90 430.5...
[2 replies] Last: Yes, they won't be separated (by jimaris)
Printing
 
Hi guys, Ive been looking at mini projects for myself to do to train myself up, and i found one about how to print a message (Hello World). It worked but now i...
[3 replies] Last: LPSTR PrintIn = new char ; try that. (by hanst99)
Trying to a string character iterator class but it doesn't iterate.
 
I wanted to write my own StringCharacterIterator class, like the one in Java, in C++. I've written the code below. The problem is in the for loop. It does the i...
[3 replies] Last: Objects are normally not created with new in C++ - and when you do, ... (by waqqassheikh)
Making a 'Grid'
 
I have been tasked for my project with creating a grid. The grid will cover only the playable area. It will be used to place specific items and environmental o...
[4 replies] Last: Look into 2-Dimensional arrays I have a better idea - don't . Ju... (by hanst99)
Which Is More Efficient?
 
I have these two lines of code: Line 1: X = ( XyzNew.X == 0 ) ? X : ( X /= XyzNew.X ); Line 2: if( ( XyzNew.X <= -1 ) || ( XyNew.X >= 1 ) ) X /= XyzNew.X; ...
[7 replies] Last: Thanks for your input, lads. Well, the example above is only an exampl... (by closed account zb0S216C)
How do I make a local variable change the global variable?
 
Here's the summary: #include<iostream> #include<cmath> using namespace std; double dist=0; struct Circle { Point centre; int radius;...
[12 replies] Last: Probably. You couldn't imagine how much I learned just from helping pe... (by hanst99)
fprintf problem (ofstream)
 
I wrote a program that creates a text file with some letters using ofstream. Now I would like to format the text so that the letters are written in groups of 5 ...
[3 replies] Last: For a stream based solution using ostream iterators, consider the foll... (by moorecm)
by ShaunL
Need Help
 
Hi guys, I'm having trouble with my first assignment. I'm not asking for someone to just do the problem for me, but rather, I'd appreciate it if someone could p...
[14 replies] Last: @Hanst99: That's right, it's IDE, not compiler. I think that was my ba... (by AKat)
Loop hole in my Loop Structure
 
Hello out there! :-) I am very new to C++ (and computer coding in general), but I have decided to take on the challenge. I am trying to read up on the C++ langu...
[3 replies] Last: Thanks, everyone! :-) I actually do have a C++ manual. I've read the f... (by disneydork11)
Pointer and new fail
 
Let's start with what I have: void SwapArray(int* arr) { int* newArr = new int ; int* temp = arr; arr = newArr; delete temp; } int main() {...
[3 replies] Last: temp is an issue. When temp was declared, it was initialized by its ... (by closed account zb0S216C)
September 2011 Pages: 1... 1415161718... 48
  Archived months: [aug2011] [oct2011]

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