Beginners - December 2011 (Page 45)

for loop's condition with char
 
#include <iostream> #include <cstdio> using namespace std; int main() { char ch ; gets(ch); for(int i = 0;ch != '\0';i++) { cout << ch ; } ...
[9 replies] Last: As to why your not printing 'a' is probably because when the program a... (by closed account 43RGz8AR)
I'm having trouble pointing into an array
 
Hi all, Im trying to write this program that will give me the Average and the Median of a set of grades within an array. I have the Average part of the program...
[2 replies] Last: Yep, that ended up solving it. Thanks a bunch Peter87! (by Willy Rodriguez)
Help displaying numbers from text file
 
I am having trouble displaying the numbers from a text file. When I run the program all it displays is garbage numbers instead of the numbers from the file: ...
[2 replies] Last: Thanks I didn't even realize I didn't open the file. (by emitremmit)
Programming grades
 
hey guys, I'm making this program which requires the user to enter each grade for each assignment listed so far. What I want to do is, for example..add all the ...
[1 reply] : I don't really get what you're asking but I have to say that your code... (by IceThatJaw)
unresolved external errors;
 
hey team. as far as im aware, this should be running, but i keep getting external error messages. can anyone point me in the right direction? // menu.cpp.cp...
[2 replies] Last: ha....ha...yes. thank you. a new set of eyes works wonders... (by Aerion4)
Explain between int and char pointers
 
I am using Microsoft Visual studio 2010. Can someone explain me following behavior? int main() { char a ={'h','e','l','l','o','1','2'}; char * q=a; ...
[5 replies] Last: Yes. The char pointer is essentially a regular pointer pointing to a m... (by wjee0910)
sorting integers in ascending order
 
So for my first year programming class, we need to write a little program that gets 3 integers in the main function, and then uses another function to sort them...
[8 replies] Last: One, you can't return an array, and two, a function can only have one ... (by ascii)
Check Speed on VS2010
 
Hello, How can I check the speed of running a code ? I use VS2010
[7 replies] Last: And about delaying,is it in the same library ? I really confused when ... (by hentaiw)
Shortening while loops
 
I've been scratching my head over this problem for a while now, I'm not sure how to shorten up these while loops into a few for loops and still get the job done...
[7 replies] Last: I got it!! i'll use a linear search :P (by phenamana)
getting bus error
 
Hi, I have a code which is compiled but it's giving bus error during execution, I could not understand the problem. Any help regarding this matter would be app...
[4 replies] Last: Thank you for your help (by mukherjee)
;)
 
Can you tell me an efficient way of writing and reading a file from two dimensional matrix?
[3 replies] Last: @IceThatJaw: Just a little note, the loop convention is actually i, j,... (by LB)
by dsr101
Can anybody help my with this C++ assignment???
 
Write a program that can sort integers, decimals, and characters from ascending and descending orders. The program has to use the following C++ features: - ...
[4 replies] Last: Could you post the EXACT error message and which line it refers to? A... (by LB)
program shutting down
 
for(int i=0;i<(length);i++) { v=string(1,file.at(i)); cout<<"v is "<<v<<endl; if(v==SPADES||v==HEARTS||v==DI...
[2 replies] Last: i had the value set as a string thats what was causing it thanks anywa... (by bbathel)
by Thetr
A nasty one
 
okay so basically I have to make a phone book of some sort... When user inputs five people and their phone numbers then the computer asks to write the users la...
[6 replies] Last: OMG OMG OMG OMG OMG I feel so stupid, this was so easy OMG, well you ... (by Thetr)
by dimi3
Create rectangles using other rectangles
 
Hello, I need a help with my programme. I have create two rectangles, one black and one red. I want to take a piece from the first black rectangle and a...
[no replies]
by Score
Help with linking error (overloaded operator on friend function)
 
I was trying to follow a homework example I found online and am getting stuck. I haven't done much with over loaded operators, friend functions, or reference...
[3 replies] Last: Since 'statistician' is also part of the namespace 'main_savitch_2C' y... (by coder777)
i want to create a loop to generate a random question
 
i want to create a loop to generate a random question,user answers,user answer be checked with true answer,if true,true++,else,false++.and next question to 10.a...
[no replies]
by TimL
Pulling numbers out of strings so they can be manipulated and returned to the string
 
We went into greater detail about strings in class the other day, and it brought up a potential problem. I understand that the <string> class does not provide...
[8 replies] Last: Yes, cstdlib functions that take in a char* can handle numbers with mo... (by JMJAtlanta)
ignoring bad data
 
i'm trying to read this data from a .txt file into arrays and some of the data is surrounded by bad data. for example: A6.75w (for a double variable). this is w...
[5 replies] Last: Here is a better implementation. This will only do the iteration throu... (by JMJAtlanta)
by nkowa
Arrays
 
Hey everyone! I'm new to this forum and I'm also a beginner in C++... At school we got a homework and I'm not sure how to start and write the functions, I have ...
[1 reply] : You will learn much more doing the exercise yourself. If we give you c... (by Peter87)
December 2011 Pages: 1... 4344454647
  Archived months: [nov2011] [jan2012]

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