Beginners - October 2012 (Page 78)

expected primary-expression before '<<' Token error
 
i keep getting the expected primary-expression before '<<' error on lines 84-88 if someone could help me figure that out that would be great and as this is my f...
[3 replies] Last: thanks alot its working great now (by gamekiller29)
What is 'n' doing? (Bubble sort)
 
Exactly as the title suggested: what is the 'n' for in this code? void bubbleSort(int arr , int n) { // 'n' bool swapped = true; int j = 0...
[1 reply] : It is the size of the array. (by Splux)
How do you see if a variable is power of 2
 
Without changing the variable #include <iostream> using namespace std ; int main(){ int a=8; while(a>2) { a=a/2; } cout<<a << endl; return 0; }
[1 reply] : Use a temporary variable 'b' to perform calculations on . (by Need4Sleep)
Switch-Case Question
 
General question about switch-case statements. If I do something like this: switch (x) { case 1: { int i = 0; int z = 1...
[1 reply] : Yes. (by MrHutch)
setfill function
 
HI is there alternate simple way for the following code to get printed. cout<<"___________________________________________________________________"<<endl;...
[2 replies] Last: thats a great idea. it helps a lot Thank you whitenite1 (by vichu8888)
Binary search
 
What is a binary search and whats the difference between binary and a normal search? Thanks in advance
[1 reply] : A binary search requires that the list of items to be searched are sor... (by Chervil)
[SOLVED] Cross Platforms
 
I would like to write applications that would work across at least two platforms, Android and Windows XP/7. (8?) Following some very good advice I downloaded an...
[5 replies] Last: These forums are fantastic. I've never been on such helpful and inform... (by Officer Dibble)
Filing in C++
 
Hey I need a simple program which only asks name and age, by filing. And tell me, too, how'd execute that program. Please help me out asap...
[2 replies] Last: Thank you so much but It wouldn't save the previous data that I'd inpu... (by Muzamil)
Programming Problem.
 
A hypermarket in Melaka gives a 50% discount for each product purchased by its customers due to Hari Raya Aidilfitri and Chinese New Year celebration. Draw a fl...
[5 replies] Last: ‎#include<iostream> using namespace std; float input_product_price(... (by mathaddict)
Convert a series of digits into numbers
 
I am supposed to read data from a file ( the data below): $1,9,5,6#%34,9 !4.23#$4,983 and convert them into digits and write the output to a file. The ...
[2 replies] Last: Well, let assume that string s contains "$1,9,5,6#%34,9". Then you can... (by vlad from moscow)
user input, if else while loops
 
Write a C++ program that does the following. 1. Asks the user to enter some positive integers. 2. Reads the positive integers from the user. 3. Stops r...
[2 replies] Last: to do reserve do this: %10 (by skarla)
by Ch1156
How to get entire contents of a text file
 
I forget how to get the entire contents of a text file. I want to be able to open the file and get every line in it and display it in the console.
[4 replies] Last: ok it all works now awesome, thanks!! (by Ch1156)
by Ch1156
Whats going on with this switch statement?
 
Ok i have no idea whats going on here, it wont let me have case 2: or case 3: in my code void Vars::Game() { int choice; cout << "Main Menu\n...
[17 replies] Last: ok i got it thanks. (by Ch1156)
Need help to call perl module from C/C++ code without loading the perl libraries
 
Hi, I am new to C/C++ and perl. I have a requirement to call a perl module from C/C++ code without loading the perl libraries. I am not supposed to use the ...
[no replies]
Horsepower converter
 
ok so i have this homework and i need some tips on how to start it up. thanks Write a program that asks the user for either Watts or Horsepower as an input. ...
[1 reply] : cin >> input; cout << input * conversion; (by Stewbond)
Problem with an array in a structure
 
Hi fellows i am making this program for a class of mine and i am trying to capture a bar code of 8 digits i am not sure wether i should should define the variab...
[2 replies] Last: Assuming you can give a struct alias name like that How do i make my c... (by Dionisseus)
by Gomboo
Hello everyone This is my homework and i need help pls write this
 
================================================= MENU ================================================== 1. Add student records 2. Delete st...
[1 reply] : Are you trying to hack the student records database? (by pogrady)
exceptions, try/catch/throw
 
hi guys i'm pretty new to c++ and am having trouble with this problem. in my main method I try to call a function which will check to see if a certain string ma...
[5 replies] Last: nevermind got it, thank you disch (by nickcplusplus)
by ing
got stuck with vector(s) processing
 
Hello Everyone!, I learn C++ by myself, therefore I have some blank pages in some areas, eg. some operations on containers, names of different operations etc...
[8 replies] Last: Thanks a lot. I will try to implement this(new to me) approach. (by ing)
Read content of stringstream
 
Hi, supposed I just read a string into stringstream. Then I want to check if this string that just being read into is a particular word. for example "dog". h...
[1 reply] : stringstream stream; if(!stream.str().compare("dog")) cout<<"not e... (by pogrady)
October 2012 Pages: 1... 7677787980... 84
  Archived months: [sep2012] [nov2012]

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