Beginners - April 2013 (Page 51)

extracting int from a string
 
How would I extract an int from a string with no spaces. for example int main() { string x = "helloworld557"; //or string y = "mynameistimmy...
[3 replies] Last: If every input has format "text number " and if the compiler supports ... (by keskiverto)
&& and || or what's the difference?
 
Hi, I've noticed other people using "and" in place of &&, I'm wondering what the difference is. I can see the advantages of the former and I'd like to move...
[9 replies] Last: The ciso646 defines macros, but the note says: "In C++, reserved words... (by keskiverto)
Problem with analysing string
 
Greetings, I've been studying programming from time to time and decided to make a text adventure, to practice what I already know. However, I have bumped int...
[2 replies] Last: tbh, I'd just use boost split to do this for you: vector<string... (by Zaita)
Linked list not printing properly
 
Hi all, I have been trying to make a linked list, but it wont print out properly with cout. The output of the program when compiled with code blocks is ...
[3 replies] Last: I was wrong when I said it wouldn't compile with Dev-C++. It would com... (by pokemon master 64)
by Tystuh
Shed some light on this please.
 
Okay i have to check a string for some things, heres the rules ------ If the first letter is a consonant, move it to the end of the string and add “ay” ...
[12 replies] Last: if ( x==1 || 2 ) is also a single condition. This is 2 conditions. I... (by Zaita)
Programming in BT5 Linux with C++
 
I am using Net Beans IDE to debug my C++ Code. I am familiar that <Windows.h> does not exist in Linux C++. What would be the correct directive preprocessor to i...
[2 replies] Last: Hmm... Well this is new to me. (by backslashx00)
Adding bullet class array
 
Thanks in advance for reading this and any help you can provide. If I'm missing anything you need me to post of my code let me know. Yes I am new to programm...
[6 replies] Last: Thank you, it's bits from my already written up pong game and patched ... (by Dylanface)
by MMag
Analyzing input string
 
Hello, How do I analyze input string from user? For example, I want "XXXXX" in one line to be parsed each character on its own. Originally, I want to f...
[1 reply] : This should help: string input = ""; getline(input, cin); for (uns... (by Zaita)
too few arguments to function
 
whenever I try to compile it to a .exe it gives me this error: C:\C++> g++ classBasics.cpp -o classBasics.exe classBasics.cpp: In function 'int main()': cla...
[1 reply] : Compare line 17 and line 40. The function is expecting a string parame... (by Daleth)
Kindly assist me
 
Hello Guyz! I Am Begginer and a desperate learner of c++ Am Habitual of Solving different problems to Learn more and more! //Write a program that asks for ...
[4 replies] Last: @ Smac89 Thanks for the advice. (by eyenrique)
whats the difference with these 2
 
Did an exercise once and still felt a little confused so I did it again. The second time around it wouldn't work properly with out the breaks. Not a big dea...
[1 reply] : Really? You mean apart from the break? The break prevents looping by t... (by closed account 3CXz8vqX)
Random number problem
 
Hi, I'm needing to generate a list of 10,000 different numbers between -1 and 1. I then have to arrange them in ascending order. Basically I have one array(ra...
[7 replies] Last: I have it figured out, thank you everyone (by gumbogogo)
OOP
 
Collections <T> int sameCount(Collection<T> a, Collection<T> b) In the Appearances class, the static Appearances.sameCount() method takes in two c ollections ...
[4 replies] Last: thanks (by paul1994)
by zmlink
please help fixing my bad logic issues.. im a noob...
 
// I am extremely bad at c++ and my class is giving me hell this semester and my instructor will not email me back to assist me with anything ive been doing poo...
[3 replies] Last: or fail trying lol ! (by zmlink)
Testing a loop?
 
Hey guys, why doesn't this function work? void CreditCard::DoCharge(/*string name, */double amount){ for( int i = 0; i < numwithdraws; i++){ last10wi...
[3 replies] Last: void CreditCard::DoCharge(/*string name, */double amount){ for( int... (by anjeloyo)
How to output array as column/row NOT row/col
 
Hi guys, ...I need to output some information in a 2 dimensional array as as opposed to , the information in the array cannot be manipulated to appease ...
[6 replies] Last: Why not just cin >> y1 >> x1 >> y2 >> x2? (both in sMovement and fMove... (by closed account 3CXz8vqX)
by SamT
For Loop Question! need assistance!
 
Hey guys, Write a program which accepts as input a positive integer and checks, using the algorithm described below, to see whether or not the integer is divisi...
[8 replies] Last: That is pretty close. Remember the idea is to reduce the number to 2 ... (by cire)
by yaraa
I have a question here
 
write a program which inputs an integer value ,checks its positive and outputs its factorial ,using the formulas n!=1x2x3....x n? I didnt understand tha fac...
[6 replies] Last: #include <iostream> using std::cout; using std::cin; using std::end... (by eyenrique)
using arrays
 
I need some help with the output of my program and using arrays. Here's the problem: ★★★★ Modify the program so that it outputs a list in order o...
[3 replies] Last: num is 0 for the entire program. #include <iostream> int main() {... (by cire)
by kg4cjv
dynamic array of pointers that grow at runtime
 
Hi, I can't for the life of me figure out why my application crashes after the 7th cin. #include <iostream> using namespace std; int main () { ...
[no replies]
April 2013 Pages: 1... 4950515253... 83
  Archived months: [mar2013] [may2013]

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