Beginners - September 2010 (Page 14)

const datatype
 
hi i want to know every thing about const & volatile i really need it every single information
[6 replies] Last: ye i nearly get it thanks (by ahmed1031)
using an fstream in a class
 
I'm in a college c++ course and we have started writing our own classes. I was trying to figure out if its possible to create an ofstream in the private se...
[7 replies] Last: I start closing the file by creating a member function that closes fou... (by jopeters)
Background Colour
 
How do you change the background colour??
[17 replies] Last: Well " Computergeek01 " to be honest with you i read something about s... (by Mihay07)
Basic Calculator
 
Hello everyone, I was wondering if I could get some help with a basic calculator I 'm working on. The calculator should ask the user to enter a first number(...
[8 replies] Last: Ah, in that case, you'd indeed be better of including cmath. (by Kyon)
by deepa
static
 
can we declared class and object static in c++
[4 replies] Last: You might also want to google 'hottentottententententoonstellingen'. (by Kyon)
by Kness
X and Semicolon
 
I have another assignment I'm working on for class, and I ran into a problem that I can't figure out (big surprise, I know). This program is supposed to calcula...
[10 replies] Last: Most likely, you are correct. All C++ has managed to do since day 1 is... (by Kness)
by EdBoon
dynamic arrays of classes
 
Hi there. I am currently coding a personal project for learning purposes. I have run into a few problems that I can only assume there is a better or more effi...
[1 reply] : Create a wave class, and have your waves of enemies contain an array/v... (by quirkyusername)
by spamme
class, 3D-Array, return style
 
Dear all, I have class names Tensor, which contains a 3 dimensional array. The access to that array can be done like in Fortran by: Tensor<double> density...
[no replies]
by Gunni
rand()
 
Is there any way to make rand() generate numbers that are bigger than 32768. Or maybe another function that does that?
[1 reply] : Sure, take a look at this -> http://www.cplusplus.com/forum/lounge/232... (by m4ster r0shi)
Problem with using strncpy() and memcpy()
 
Hi! I'm having a problem with using the functions strncpy and memcpy(). I'm writing a function to initialise a structure. It gets two arrays passed by ar...
[1 reply] : Both strcpy and memcpy need source and destination addresses. field_tw... (by hamsterman)
by Kness
Odd error in program
 
Hello everyone. I'm new to C++ and programming in general, and this class I am taking is throwing me for a loop. I have an assignment where I am supposed to use...
[3 replies] Last: I looked over the code you listed, and it appears that you moved the f... (by Kness)
by garob
error in counting occurances of a character in a std::string
 
Can someone please tell me what is wrong with this code: }while(int((count(code.begin(), code.end(), std::string("\""))))%2 != 0); I get this error: ...
[2 replies] Last: Sorry it was an std::string. I ended up writing my own function anywa... (by garob)
Complete noob question - if / else
 
Heya guys :) Currently coding a converter for days into weeks and days. It all works fine, and allows me to convert the amount of days I want into weeks a...
[2 replies] Last: You should read up on control structures. http://cplusplus.com/doc/tu... (by Thumper)
by meca
min and max
 
hello guys... can you help with my assignment...my instructor asked me to program about min and max...the output must be like this. enter no1 = 34 e...
[5 replies] Last: your code shall work but this part has no use if (n1==n2){ max = n1;... (by ahmed1031)
by mp9191
STL sort - vector iterators incompatible error
 
Hello, I'm new to these forums (and fairly new to C++), but I read the rules so I hope I don't break any :) Basically I have a string vector called final,...
[6 replies] Last: I figured it out myself! Sorry to have bothered you guys, but I do app... (by mp9191)
how can i delete a line in the textfile using c++?
 
delete: { int x,y=0; char str ; char tempid ; clrscr(); fstream my_file; my_file.open("data.txt",ios::in|ios::out); if(my_file.fail()) { cout<<"\nF...
[8 replies] Last: trapsearch is to check if the entered student number don't exist. i... (by atse013)
exercise
 
I have an exercise again and I got blocked again. The exercise is: Daphne invests $100 at 10% simple interest. That is, every year, the investment earns 10% o...
[8 replies] Last: It is only working for some values of deposits. If you choose deposit... (by nathan10)
by deepa
pls answer these que
 
a class having no name 1. cannot have a constructor 2.cannot be passed as an argument 3.cannot have a destructor .4 all of the above(in c++)
[1 reply] : pls answer this que when you don't know about homework 1. study 2.... (by Bazzy)
Inilializing array
 
Hello. I want to do something like this: int testArray = boolVariable? {{0, 0}, {1, 0}, {1, 0}} : {{1, 0}, {1, 1}, {0, 0}}; But I get errors. Why I...
[1 reply] : Well, you could try this: int tmp_array_1 = {{0, 0}, {1, 0}, {1, 0... (by hamsterman)
by juvan
String problems
 
Hi all, I am totally confused about this, and why it doesn't work string sBuf; string *sNames; fFile.open("id22-names.txt"); if (!fFile...
[2 replies] Last: Nice, no more exception, but it behaves a bit wierdish. Let me just sh... (by juvan)
September 2010 Pages: 1... 1213141516... 32
  Archived months: [aug2010] [oct2010]

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