Beginners - April 2012 (Page 2)

Understanding pointer casting with const
 
I am a newbie programming in MSVS2008. I am struggling to understand this casting which is correctly working code: int compareQuantityAsc(const void *a, con...
[1 reply] : For the code to be const-correct, you should not be casting away the c... (by JLBorges)
#ifdefine question
 
When I coding my program in separate files, I use definition macro for file test.h like this: //------------ #ifndef TEST_H #define TEST_H ..... ..... #...
[4 replies] Last: > The only thing that you want to consider is making sure its unique. ... (by JLBorges)
Pointers or arrays ?
 
Hi, I'm about to start a new project about processing data stored in text file (all data are of type double ) and I'm wondering which appraoch is the best (in...
[9 replies] Last: Thank you (by nadir CoCo)
PLZ Help me .. in Arrays .
 
In network simulation, node placement is one way to create and describe a simulated network. Write a C++ program to create a node placement file named “Nodes_...
[no replies]
can someone help with this tic-tac-toe project?
 
i have been c++ programming for a couple of months, using Microsoft visual c++ 2008, and i am trying to do a program that lets you play tic, tac, toe. i have th...
[5 replies] Last: @newbieg - I would refrain from posting full solutions on here as far ... (by MrHutch)
Convert string number to Int
 
I know this is a very newb question to ask and all, but is it possible to convert a number in a char or string variable into an int variable? in effect I wan...
[5 replies] Last: http://www.cplusplus.com/doc/ascii/ this gives the entire table, but ... (by Danishx83)
"error: cannot convert ‘Funct’ to ‘int’ in initialization" when trying to use functors.
 
I'm trying to get the hang of functors but I get this error on line 18. I'd really appreciate it if someone could tell me where I've gone wrong. #includ...
[10 replies] Last: @vlad from moscow. That's brilliant. Thansk a lot for your help :-) (by waqqassheikh)
Getting ofstream junk
 
I am new to programming and I am trying my best, however I am having trouble with my output. I keep getting junk in my output files. The idea was to create a m...
[1 reply] : You are calling your functions incorrectly in main. Wrong. void Rese... (by vin)
srand initialization
 
My main question is at the very bottom. The information here is supporting info. I am a fairly experienced programmer and have fairly good understanding of goo...
[4 replies] Last: My actual question however remains unanswered. Why is it bad to initi... (by codekiddy)
Arrays
 
Short code that i am trying to write. Does a couple things. Makes a 4 by 4 array with the numbers 10, 11, 12, 13. I am supposed to have a function that tells me...
[6 replies] Last: Perfect. You have once again managed to impress me. Thank you very, ve... (by needhelp2345)
Calling a private class help?
 
#include <iostream> #include <windows.h> #include <string> using namespace std; class addClass{ public: void setInt (int x) { add2 ...
[3 replies] Last: setInt takes one argument so passing two arguments as you do on line 3... (by Peter87)
Math Solver
 
I am currently in school obtaining my bs in computer science and hate math and since i dont use it I had an idea. Is there a way to make a algebra math solve...
[7 replies] Last: hehehehe... you can't be more wrong my friend, programming depends dee... (by TheDestroyer)
cant get the correct return value for calc
 
#include <iostream> #include <windows.h> using namespace std; class addClass{ public: int add2 (int x,int z) { int ans = x+z; cin >> x; ...
[3 replies] Last: thanks JL, it worked. (by capitolstorm)
Binary File Error
 
The code compiles but does not record (or) show the data properly. It only displays the last entered data. I couldn't figure out what exactly is wrong. I woul...
[no replies]
push_back(class)
 
I've got a class containing 3 floats. class a{ float x,y,z; }; And I created a vector with that type. vector<a> b; How do I use the push_back ...
[11 replies] Last: yes (by en liten kille)
I need a lot of help
 
I'm having a lot of trouble writing this program. It's supposed to take student grades from an input file and display them next to the students name. and then d...
[no replies]
getline function skipping function
 
Is the getline function supposed to stop and allow the user to enter info? How can I get it to do this? The display shows: Enter name. Enter number. Then it ...
[1 reply] : Are you using the extraction operator on cin e.g cin >> somewhere in... (by vin)
by amkmt
error C2228: left of '.printPatientDemographicInformation' must have class/struct/union type
 
I am new to C++ programming. Can anyone help and let me know what I did wrong here? I tried to create three objects by calling the constructor from the header f...
[1 reply] : The part where you declare your objects is incorrect. It looks like yo... (by Zhuge)
NEED HELP ASAP
 
Ok so there is this project I have to do for my programming class. It opens a file and then computes volumes with a link list. It will then sort the volumes and...
[2 replies] Last: Actually I figured it out! It was something silly. I didn't put my fun... (by Andrew2172)
by JohnG
how
 
;fs
[1 reply] : http://www.cplusplus.com/forum/beginner/69677/ (by cire)
April 2012 Pages: 1234... 66
  Archived months: [mar2012] [may2012]

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