Beginners - October 2010 (Page 36)

while and priming read
 
I am writing a loop that reads text from a file one char at a time and prints it to the screen. I don't think I understand how to code the priming read. I have ...
[6 replies] Last: I see both executions thanks again (by pistol1)
Problem with input output functions
 
Ok. Hello people... please FORGIVE me if this exact same question is somewhere in these forums. But here we go.. I was trying to write a program to expand my k...
[5 replies] Last: Ok I got a chance to ask my teacher today, she suggested something lik... (by vlvskyvlv)
Infinite Loop problem
 
I've searched around here and on the internet for some solutions to this, but I can't seem to get it figured out. Basically, I am writing a very, very simple c...
[8 replies] Last: Realised lines 134-138 (below) only needed once so 32-40 removed. Go... (by AlphaBravo)
"const char" recognition as lower or upper case
 
I'm writing a program that counts the number of times a grade is entered, using a while loop. I have the sentinel value as Z, but I'm not sure how to make it re...
[2 replies] Last: Strange, I thought I tried that, obviously not though. Thanks. (by Greywolfe1982)
default constructor
 
I am trying to uderstand how default constructors work. Can someone please show me how they would be included in the following example not a perfect code I know...
[1 reply] : std::string myName; // Runs the default constructor (ie, the const... (by jsmith)
by dlugo
while loop, loops forever
 
Why does this keep looping forever? std::string word; while(file.is_open()){ file >> word; Element item; ...
[2 replies] Last: I assume you want to read the whole file. So instead of std::strin... (by filipe)
no output
 
there is no output when i type age #include<iostream> using namespace std; void main() { int a; cout<<"What is ur age?"<<endl; cin>>a; if(a<...
[15 replies] Last: You are starting to write some nasty stuff, I suggest you shut up. (by closed account 1wqDSL3A)
C++ Problem: Garbage in char array after copying
 
Hey there, I'm having a bit of a problem with a C++ program I've been writing and I was hoping you guys might be able to help me. This issue has been really ...
[no replies]
lists and new objects
 
hello again please consider the small piece of code below? bunnyList.push_front( new mutantType ("Black")); It simply creates a new pointer to a mut...
[5 replies] Last: Is ptr_list part of a standard library?, or do have to download it fr... (by Athar)
problem with program
 
hi, i have a problem with this program, the program doesn't execute the line (cin.get ) plz help #include<iostream> #include<string> using ...
[no replies]
Advise me
 
Hello, I am a junior computer science major, I took the first part of C++ and I made an A, now I am taking the second part ( function, arrays and up...). ...
[3 replies] Last: Try to change (mentally) those problems, with new challenges, and set ... (by MottMan)
Game of life problem
 
Hi guys, i need to make the Game of life in C++. I get a run time error when i run this program, it compiles fine. This is the .cpp file in the project. Dont kn...
[6 replies] Last: can you provide us with starting_grid.txt too? (by wtf)
Hash a generic object
 
I am trying to create a hashtable that handles generic objects. I would like to use the same hash algorithm for any type of object... Is there a way to do this ...
[10 replies] Last: Agreed there. One misuse of a boost::mpl::vector<> gave me about 22K ... (by jsmith)
by Adciz
Beginner BEDMAS Question
 
Hello! I have a question about how the order of operations works when doing simple math with C++. All of the forms and tutorials I have read say that C++ follow...
[2 replies] Last: what is happening is integer division. 3/4 = 0. use 3.0/4 to avoid thi... (by hamsterman)
by khris
splitting a string of integers... (1,2)
 
Hi guys, I am having trouble with a specific problem. Is there a way to split a string of integers? For example, I want the user to input a big number, such a...
[32 replies] Last: I like the way you are going about this. I'm going to look a little d... (by khris)
c++ sort/search error
 
Hello i am new to c++ and this is one of my first programs. I am trying to sort and swap the data array by descending sort. I can not move the actual array a...
[2 replies] Last: PanGalactic+1 Though one thing I can tell you: 1 <= position <= n d... (by hamsterman)
While(???)
 
I have the following thing written: #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #i...
[15 replies] Last: @ sohguanh But then you have duplicate code. Like in your example,... (by Disch)
Newbie GUI Question
 
Hello. I have not yet started studying c++ since i am trying to collect information on it. The part i constantly fail to understand, has to do with GUI programm...
[1 reply] : a) No, but an IDE always helps b) Not much if you use cross-platform ... (by Bazzy)
inline is out of scope?
 
below is my program general.h #ifndef GENERAL_H #define GENERAL_H inline void func_exitprint(char *s); #endif general.cpp #include <stdi...
[4 replies] Last: Just to clarify, the definition belongs into the header. (by Athar)
what are these errors?
 
hello can anyone tell me what i am doing wrong here? when i try to build this i get two errors; : error C2059: syntax error : ';' and fatal error C1075: end o...
[7 replies] Last: Thank you LB. I know that I wasn't directly told do not ask for h... (by cmarie1)
October 2010 Pages: 1... 3435363738... 42
  Archived months: [sep2010] [nov2010]

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