Beginners - September 2013 (Page 52)

How would I create an input and ouput file, at runtime if they do not exist?
 
Below is the code I am playing with (I realize its not working currently) but wanted to know if there is a good way to accomplish this Doing a bunch of i/o ...
[1 reply] : if you try to open a file with ofstream and it doesnt exist it will cr... (by closed account Dy7SLyTq)
Structured Data: Nesting Triangles(using structs and doing some geometric calculations)
 
nestedTriangles.cpp (attached) description: The program takes as input a pair of triangles, specified be giving the coordinates of each trangle's vertic...
[no replies]
by Aibsr
operator[]
 
What should the operator return in a function that returns the -n-th element in a list? //This is the Class class Customer { private: string name; long ...
[2 replies] Last: Thanks (by Aibsr)
file text problem!!! Solution needed!!!
 
once i enter the second name... but the file only contain one name which is the last one i have entered... i want to save every name i have entered... #i...
[4 replies] Last: Info on arrays: http://www.cplusplus.com/doc/tutorial/arrays/ If I w... (by BardaTheHobo)
Program to count characters, words and lines
 
I have a program that is written here that is not providing accurate counts on lines and words. I haven't counted the characters but see no reason to believe t...
[no replies]
Global variable being ambiguous?
 
Hello, thanks for viewing my question. I am teaching myself C++ from a book; the program below is supposed to show an example of local and global variables a...
[5 replies] Last: Arrh thank you, I understand it now; I thought that was what it was us... (by SoftMOUNT)
Fstream and structs conflict?
 
I'm trying to read in strings and integers into separate arrays using structs but it's not working right I have a file with 3 name and 3 ids. Ex: James 34 Sa...
[2 replies] Last: (++count is better than count++) ++FOO increments FOO and returns F... (by Daleth)
All Same Array
 
Hi, This function only return to true in every case. I want to return to true if all the array elements are same. bool allSame( const unsigned a , unsign...
[3 replies] Last: You could, for each element in the array, iterate over the array again... (by Daleth)
References and de-references
 
http://www.cplusplus.com/doc/tutorial/classes2/ What does it mean to have a -> de-reference sign in a if statement and why is the & reference needed in the p...
[1 reply] : Check out the section on data structures, it explains the arrow operat... (by Danny Toledo)
i need help..check my program and help me plz
 
write a c++ function void sum(double& sym,int n) which calculates the sum 1/1+1/2+1/3+...1/n where n is positiv integer.function returns the sum via refrnc para...
[7 replies] Last: please tell me how to print this on screen? All you have to do is ad... (by Danny Toledo)
Member Initializer List
 
How exactly does Member Initilizer List work?
[2 replies] Last: thank you so much, you've been very helpful (by Filip Cvetko)
errror help expected ';' before ')' token
 
Hi, quite a newbie here and having problems with a function. Getting an error that says expected ';' before ')' token double Jacket_size(double weight,do...
[2 replies] Last: wow! stared at that for an hour, and was lost. Thanks so much!! (by Pepper12704)
by Nalin
Reading STL file (stereolithography)
 
I've been searching for instruction to read STL files. STL files are generated by CAD software and come in ASCII format and binary. i tried using fopen(,...
[no replies]
Have i set this up right so far?
 
Complete
[1 reply] : Yeah, it looks conformant to the initial problem description. (by TheGrayWolf)
Why are my variables not initializing
 
Hey, worlds worst programmer here with another(hopefully) simple question. I'm trying to create a palindrome using five variables. Only problem is that the fe...
[2 replies] Last: num1,num2,num3,num4,num5 = atoi(buf.c_str()); This seems stra... (by abhishekm71)
by elfeck
Setting pointer in function
 
Hello, I want to do the following: class A { private: B* myPointer; public: void someMethod() { B b = B(); b.setPointer(myPointer...
[3 replies] Last: That doesn't appear to accomplish anything. At line 8, b is local... (by AbstractionAnon)
Can't read from file for no reason
 
HI! I have two functions they are exactly the same : int ShowStudentsInfo () // This function reads the file "student.txt" and shows all of the information...
[3 replies] Last: Thank YOU @nevermore28 and @AbstractionAnon Yes I'm sure there is no n... (by Ardeshir81)
Suggestions on a saving/loading system with enumerated info
 
Currently I'm saving all the enumerated info by writing the enums to file and loading is working fine. The problem is if I later decide to reorder the elements...
[no replies]
how to separately add two statements into a file text?
 
void cakeType () { int id; cout << "Cake ID Flavor" << endl; cout << "0101: Chocolate" << endl; cout << "0102: White chocolate" << endl; cou...
[4 replies] Last: You do write explicit std::endl after price in your code. You do clos... (by keskiverto)
Replacing one character with two
 
Hello guys, I an new to c++ and tried to do a program wherein the user enters his name and each letter in that name gets replaced by two other letters , for e...
[5 replies] Last: well thanks (by madara uchiha)
September 2013 Pages: 1... 5051525354... 64
  Archived months: [aug2013] [oct2013]

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