Beginners - January 2012 (Page 4)

by abc1
displaying first character in every line
 
How to display the first character of every line of a file? Please anyone help me
[2 replies] Last: read the file character by character and check them by '\n' ( if(ch=... (by Bixx)
How to print doubles entires without +06e etc.
 
A smallest question I want to print doubles entires without +06e etc. after numbers become too big. If someone can quickly answer what i have to write. I...
[7 replies] Last: Its the fixed. double a=10000000000000; cout.precision(2); cout << ... (by imakaia)
Error: function overloading
 
Here is a small program demonstrating function overloading, there is a problem with the char version of print_arr, it causes the program to crash and I don't kn...
[3 replies] Last: Thanks, damn typos in my book :( (by Integrater)
C_String buffer overflow: array boundaries with cout
 
Dear C++ users, I am currently learning C++ and need some precision about the cin/cout extract/insert operators and buffer overflow. Here is a small progr...
[3 replies] Last: Many thanks to both of you for having answered so quickly! Things ar... (by HumbleNoob)
Getting $0 for tax in a program
 
I... am gonna murder this computer. Okay. So when I enter the sample values of "50, 25, and 35" for beef, chicken, and vegan meals respectively, I get all the ...
[4 replies] Last: The real reason is the 'ROOMCOST' is an integer. If ROOMCOST < 100 and... (by coder777)
Using "cout <<" when pointing to a class' string member
 
Hello, dear skilled programmers! I've run into a problem which is too complex for my very elementary skills. I have a game in which I have a class which cont...
[4 replies] Last: Thank you very much! You've been most helpful! (by Tallrick)
Overloading the >> operator
 
Stuck again =( This is my implement file: #include "cscd305.h" CArray::CArray() { this->m_array = new int ; this->m_size = 10; } CArray::CArr...
[3 replies] Last: Post your actual files then (by guestgulkan)
Using static_cast and setw()
 
I am making a report for a class in c++ and I am stuck I cant seem to get it to display a calculation in double form, here is the code int speed1=static_cas...
[1 reply] : I bet you declared both DISTANCE1 and point1time as integers. Integer ... (by hamsterman)
Herons Formula Help!!
 
Learning Objectives • writing a C++ program that does input and output • using Math Library functions A triangle is a three-sided polygon. Every triangle...
[16 replies] Last: could you look at this topic and tell me what I am doing wrong. it is ... (by JCharles)
Getting "Undeclared Identifier" for something I declared
 
EDIT: New problems, update post added at the bottom. I'm new at this site. Name's "TheFool", because I am the fool when it comes to programming stuff like th...
[9 replies] Last: Yeah, I was originally planning to remove the ROOM1, ROOM2, etc. value... (by TheFool)
is there any restriction of data type in struct???
 
I am a newbe in c++/c. and recently I am trying to read data form a Collada file.so I have to define the data struct to store the parsed data in the memory. I ...
[3 replies] Last: vector is in the std namespace. Try std::vector<Image> m_Images;... (by Alrededor)
Recursive Binary Tree Find Largest Subtree
 
Wondering how I can recursively traverse a binary search tree Pseudo code or actual code would be helpful here in this case. ...
[2 replies] Last: for each sub tree call get sum find which has the greatest sum g... (by LB)
Pong, mltiplayer
 
I'm trying to make a 2 player Pong console game. To move the counter (up and down) on the left side, I use 'W' and 'S', and on the right side I use 'I' and 'K'....
[8 replies] Last: well on youtube I got alot of help from TheNewBoston and as a plus he ... (by alucard33592)
Monthly Payment Calc
 
whats up guys, i been writing my code for a simple loan calculator but i keep getting errors, every thing seems fine except the formula part.. heres the code ...
[5 replies] Last: ok it worked is nothing like the original thought, here is the code m... (by Mr Baron)
Why is my array not being passed correctly?
 
I have a 2D array which I'm trying to pass to another function but when I go to pass it, the function which I'm passing it to only gets one "row" of the array. ...
[8 replies] Last: Figured it out....It was my compiler (Visual stuio 2010) that wasn't d... (by hopesfall)
Reading white space?
 
My program asks for user input and is in the format of "10 11 12". I want to do something like cin << userInput but when I use that, I only get everything ...
[2 replies] Last: getline(cin, userInput) (by kapo)
Can't seem to sort this Array
 
Hello, I am working on an assignment to take input from a file, populate several arrays, then sort the data. I am getting hung up on the proper way to alpha...
[1 reply] : I'm not going to change what your are doing, just suggest what you mig... (by histrungalot)
Need Help to fix the errors.
 
hi there, I am new to C++,here is my first homework for this semester. I really don't know how to fix these errors. please help!! thanks here are t...
[6 replies] Last: These are code tags: [co de] (by Zhuge)
Getting values from comma separated string?
 
I have a string which has values separated by commas and I need to retrieve one value at a time. The string looks like "1,2,3,4,5,6,7," and I want to get just t...
[1 reply] : You could use string::find() to find the first comma, then substr() to... (by Zhuge)
unabel to resolve identifyer myfile
 
Could some body please explan why this code dose not work #include <iostream> #include <fstream> using namespace std; int main() { fstream myfile ; myfile.o...
[5 replies] Last: On the line you try to call .open() myfile no longer exists. Your code... (by Zhuge)
January 2012 Pages: 123456... 48
  Archived months: [dec2011] [feb2012]

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