Beginners - October 2010 (Page 25)

How this is working?
 
Hello to everyone ,i found the following code somewhere and i can understant how this is working? int a=312312; int* b; b=(int *)a; cout<<"b-->"<<b<...
[3 replies] Last: Ok got it,thanks!!! (by kikirikou)
by ZondaR
getline command
 
The second getline in my code doesn't seem to be working. The first get line reads the input fine but the second getline for the variable "occupation" doesn't s...
[2 replies] Last: You are mixing formatted (<<) and unformatted (getline) input. Don't d... (by Duthomhas)
class instance error
 
hi everybody; I have a prob. with declaring a class instance can someone get me help here is the main body: #include <iostream.h> #include <conio.h> #in...
[no replies]
by ARWA
the base class is not found!
 
hi every one im working with some exersies which include inheretence every thing is fine except that the compiler dose not recognize the base clase it says E...
[10 replies] Last: ok ^_^ thanks its working now.. (by ARWA)
The case of the mysterious disappearing stringstream...
 
I'm getting a very strange output from a function of mine. The idea is for it to format string information of an item in a catalog (a map, with int key and "Pro...
[no replies]
Getting the next element in a set without incrementing the iterator?
 
Hi all. I'm trying to do something like this: std::set<int> mySet; //********* //insert some elements //********* std::set<int>::iterator first = m...
[5 replies] Last: Does not first++ CHANGE what first points to? No, a correct impleme... (by Athar)
binary files
 
Hi guys, I'm feeling confused on random access binary files. When creating a random access binary files, do I have to convert everything into a const char* ...
[3 replies] Last: Actually for binary files, write byte by byte to the file in binary wr... (by sohguanh)
Simple class program
 
I'm having a bit of trouble here with this class program. I've tried inputting the prototype for the the main function but it's not working either, so I'm a a l...
[13 replies] Last: Also line 18. t1.mileage is a function not a variable. If you want it... (by MaxT)
how do you use char for multiple charector input
 
i've been trieng to use char for multiple charector input, but it wont work! someone please help
[6 replies] Last: I think that was the problem though, 2 characters were needed for his ... (by AlphaBravo)
by ender2
STL List insertion and retrieval?
 
Without getting too in depth, I’m reading lines from a file and creating the object “com” which I’m inserting into a list and trying to iterate back thr...
[1 reply] : committeeClass com; ... while (!fil.eof()) { ... p = committee... (by sohguanh)
Why this prints Garbage?
 
I'm going over an exercise from a book, which basically says the following: Write a program that defines a vector of pointers to strings. Read the vector, p...
[4 replies] Last: However I have one more doubt.. Is the delete statement delete *iter;... (by sohguanh)
by Yitzu
std::cin.get();
 
I just made a little program and to stop it before ending it i used the code system ("PAUSE"); and it worked properly, but before i knew about it, i was using s...
[1 reply] : Try this instead; cin.ignore().get(); That always worked for m... (by AlphaBravo)
countdown();
 
Im trying to create a countdown function after I drew the numbers using DrawLine from 9 to 0. The numbers are all on the same location on form1. I want them to ...
[no replies]
simple/short code wont work (char and if)
 
#include <iostream> #include <math.h> #include <string> using namespace std; int main() { cout <<"String:\n"; char i ; cin >> i ; if ("aa"==i) ...
[2 replies] Last: if same string strcmpt(string1,string2)==0 and else strcmpt(stri... (by dandy)
What am I doing wrong?
 
I am trying to write a simple program that asks a user to enter a year, and the program will take the year and return an integer value. I am trying to accomplis...
[1 reply] : #include <cstdio> #include <cstdlib> void getyear(int y); int ma... (by dandy)
by ToniAz
Inputing into a double vector
 
Hello everyone! I have posted something on this yesterday, I was hoping that finding the flow in part of the code would resolve the whole issue but I was wro...
[19 replies] Last: Dear Galik, The program finally worked smoothly, and correctly ...... (by ToniAz)
Do you have any methods to speed up the dynamic array?
 
I am using the library of boost to create a 2D dimensions array and compare about their speed There are three kinds of array, matrix of boost, multi_array...
[4 replies] Last: Thanks a lot, maybe express edition never do the totally optimizatio... (by stereoMatching)
How do you round numbers?
 
I've been writing a program that looks through a set of data and chooses the value that is the highest and all the data is of type double. If for example i have...
[2 replies] Last: That truncates. 32.5 --> (int)32, not 33. I wrote an article on thi... (by Duthomhas)
by zimz
if statement being skipped after validation
 
Hi Below is a copy of my code for a homework assignment. I need to validate the input of hours. The validation appears to be working, but then it will skip...
[1 reply] : Much of what you did was repeated. For instance, inside each of the ca... (by AlphaBravo)
multi character char?
 
Hi everyone! Im new here to the forums so im gonna give this a try. Im taking an intro class to c++ and although ive been doing pretty well im stuck on a smal...
[9 replies] Last: Yes, I agree that switch and case are cleaner -- which is why I gave y... (by Duthomhas)
October 2010 Pages: 1... 2324252627... 42
  Archived months: [sep2010] [nov2010]

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