Beginners - November 2010 (Page 2)

digit counter
 
hi everyone im new to c++ and sorry for my english.i want to make a basic program which count digits in number.after program starts we enter 5 number.after then...
[10 replies] Last: It does not matter ^^ (by firix)
ternary vs if
 
In what situations would you use either one? And is there a differents the ternary: z = (x > y) ? z : y; looks the exact same as the if: if (x>y)...
[6 replies] Last: If you have something that can be neatly summed up in a ternary operat... (by Disch)
Splitting a linked list
 
I imagine I'm going to have multiple questions with this one. Please bear with me. I am to split a linked list. I'm required to use this base class function...
[7 replies] Last: Alright, so some progress has been made on this one. The program runs... (by Erdrigard)
formating output to new lines
 
The program i am working on is taking an array of 50 numbers and i need the output to display 10 numbers and then start a new line. What do i need to add to the...
[2 replies] Last: Thanks! This solves the problem for now. I know there has to be a way ... (by thebirdman26)
Displaying ships on a game grid and other things
 
Ok i seem to be getting the same kind of consensus with my program so far. Im to do a game where there are two ships (the player's ship and the computers ship) ...
[no replies]
Problems with shipment program, assistance needed fast
 
Hi, I have a program for school and I need help with it. Because my teacher has become absolutely no help and this program is due in an hour and a half, I need ...
[4 replies] Last: I think it is lower case, but that's not working either. At this point... (by YoshiEgg25)
Segmentation fault error
 
I am trying to write a code that reads data from a file, after reading the data it should look for duplicate and write only non duplicate values to a new file. ...
[2 replies] Last: Tho this might not help regarding your question, i suggest try to use ... (by Rave)
A pointer and dynamic array problem
 
1) create a data file of the following structure (each represents the test scores of a class): the first two numbers are the number of students and the number ...
[1 reply] : Just being honest: You have not clearly defined your SPECIFIC problem,... (by closed account 1yvXoG1T)
by Sauve
Arrays
 
Hello, I am running into problems trying out an array exercise. I have the array initially set to NULL. When i try to give it a size, I can't figure out why it ...
[no replies]
by jjp
How to get a percentage ?
 
Hi, I had to write a program that determines the frequency of a letter specified by the user in an input file. I figured out how to do all that, however, we...
[1 reply] : well what is a percentage? It's a value out of 100. So if counter is t... (by quirkyusername)
Intro to c++ class game project
 
Hey guys, so i have this project due on the 13th of Dec. I have been trying to work on it but im at a roadblock pretty early on and im just at a loss as to wh...
[6 replies] Last: Halp? (by halopower67)
how do i
 
how do i make my console app. to work on any pc with out needing to have netframwork :-s
[2 replies] Last: idk i have coded a applc workin on any windows 7 but xp it not workin ... (by Abanoup)
How To Repeat It?????
 
How To Repeat that program many many times???? #include<iostream.h> #include<conio.h> #include<cstring.h> class quiz { public: void choice() { string...
[7 replies] Last: It is probably the same as a while loop, but the main issue is that it... (by firedraco)
by exca
trying to initialize a field of the object in a vector
 
Hi all, I have written a program and in some part of my code it takes input from the console and according to that it creates pointers to objects and pushes ...
[4 replies] Last: hmm... and then how should i delete all those objects in that vector? ... (by exca)
Using swap to effectively clear vector
 
vector::swap can be used to effectively free allocated memory. ie, vector<int> v; vector<int>().swap(v); Maybe someone can explain why this is better the...
[3 replies] Last: The value of capacity() is always implementation defined (by Bazzy)
code done but still got abit problem (1,2)
 
#include <iostream> using namespace std; void menuFunction(); void addFrac(int num1, ...
[20 replies] Last: void menuFunction() { int choice... (by blurterry)
by waxman
getline function not working
 
Hey everybody, I'm working on a simple spreadsheet application, and I'm trying to have the user enter a short label for a cell. I'm trying to use the getline...
[2 replies] Last: You're my hero hamsterman! Many thanks! (by waxman)
Check if there's a space before a word in a string
 
Hey, Is there a nice and easy way to find if there's a space before or after a word in string? Lets say I have a string like this: "Blue apples are cool" ...
[5 replies] Last: [quote=Alvyxaz]if(str[i-1] == " ")? Nah, it doesn't work like th... (by Return 0)
by firix
Error( multiple template parameter lists )
 
Hi Guys, this code does not work Where can I have done wrong template<class T> class SimNode{ T data; int link; public: friend class SimSpace...
[no replies]
undefined symbol
 
Hi, I've compiled a program (called Knit)on ubuntu with the command line (make python) but the problem comes when I tried to use it and exactly after the com...
[1 reply] : Linking is just a common error in C++ it also exists in other language... (by Computergeek01)
November 2010 Pages: 1234... 42
  Archived months: [oct2010] [dec2010]

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