49,761 Topics
| |
I'm having difficulties understanding and printing the max value of a size_t type. Apparantly the size_t is typedefed to a unsigned long int on my system. Is this safe to assume its the same on all c++ compilers? The 'sizeof' function returns the number of bytes(size char), used to represent … | |
I am trying to write a racing game but i need some winning conditions. Im not sure where to start, any pointers would help. Im using Visual C++ | |
I'm towards the end of my problem. I just need assistance when comparing classes. I'm trying to compare the two Grade point averages, and whoever has the highest, I would like to be announced or displayed. Any help or hint is appreciated... [code] #include<string> #include<iostream> using namespace std; //class of … | |
- I've Implemented a very simple non repeated random generator and I want to share it for anyone .. - I want Your Opinions Please , and any comments about my code - Anyone notice any fault in the result (any repeated numbers), please report me - Thank You Very … | |
Hi, I've just joined this website for help with some C++ problems. I am new to C++ and face the task of reading from a text file and outputing the result in another text file using the[B][COLOR="Red"] istream& operator >>(istream& stream, storage &s)[/COLOR][/B] it looks like something underneath: istream& operator … | |
Ok so i have to print a table of data like so.. SURNAME LAST NAME ADDRESS POSTCODE right? but the problem is the text won't align to the appropriate heading. so when i try to use tabs if someone has a longer surname or whatever this happens. [CODE]SURNAME\t LAST NAME\t … | |
I need clues for making a programe suppose there is sample data set in file sp13Input.txt. A 555-1234 B 555-1111 C 555-2222 D 555-3333 E 555-4444 F 555-5555 G 555-4321 z 000-0000 we have to make linear search,by giving the number and it will display the name of the person … | |
I am trying to get music to loop in the background of a game. However im really not sure how to do this. Can anyone give me a starting point please? I am using Visual C++ btw. | |
Hey all I have been writing my own implementation of a BigInt class and I think I have most of it down. I am using a vector<int> container for my number. I'm curious to what you guys think about. This is my first program using 1000+ lines of code. Please … | |
I am using MS SAPI (5.1 or 5.3) to read a script using a call like this (in MS VC++): [CODE]Voice -> Speak(script.AllocSysString(), SPF_DEFAULT, NULL);[/CODE] I want to be able to limit the total duration of the time spent reading the text to length X (hard limit). Is there a … | |
Hi, I want to ask you, how can I do a program, which will be read characters from a keyboard in random time. I mean it, that if I write some characters on a keyboard in every time, when I come to the PC, it save it to txt and … | |
So I have this assignment in which I need to use Selection and Projection operators on n-ary relations. The book really doesn't cover it in a way I understand and doesn't explain it in terms of c++, so could someone help me out. Could someone give me a "c++ code … | |
Hi, I've been working on this one problem in C++ for hours, starting last night. I haven't been able to figure it out completely but have been able to complete 3 of the 6 functions required for the program. I'm in the process of completing the fourth and have run … | |
Hello guys, I've a class with a cpp and .h files. It's a part of a large program. I would like to create an array of structs and use it wherever in the same class, i.e. I want to initialize it in a specific function and use it in other … | |
In my code my "ndeps" is not being declared in my "setdepends" function and i dont know why. Can anyone help me figure out why? [CODE] #include <iostream> #include <fstream> #include <cstdlib> #include <cstring> using namespace std; class Object{ private: Object **depends; int ndepends; public: Object(); char *id; enum Color … | |
I got some linker error, couldnt find the mistake. What is wrong? [CODE]#include "myStack.h" //Imports the Stack header file containing the declaration of the member functions myStack::myStack() /*The stack is initialized as empty */ { count=0; } //end of Stack::Stack constructor Error_code myStack::push(const Stack_entry &item) /*If the stack is full … | |
Hello fellow daniwebians. Consider the following constructor: [CODE=C++] Vector3f::Vector3f(float* f) { x = *f; f++; y = *f; f++; z = *f; } [/CODE] Now let's create an object of the Vector3f class [CODE=C++] //Create an object of Vector3f Float f[] = {13,3,7}; Vector3f myVector(f); [/CODE] All is well right … | |
Hi, I have a special question about banners that usually is possible to put on a webpage with HTML code. The HTML code holds some addresses to this specific banner in form a http:// addresses. As C++ can call addresses like this my quesiton is this: Is there any possibility … | |
| Hey, before everything, sorry about my english, i will do my best I'm really new at this, i just want to know where i should start learning about security, control of ports, control the sockets already initialized for other program, viruses, spywares, hack, nukes, etc.. I'm just asking for sources(i … |
Hi, CPP : How do i call a function in another program? the main function is in one program and i want this main function to call a function in another program. Can anyone please give me the sample code for this? Thanks in advance | |
Hello all, I am trying to find a way to graph the [URL="http://en.wikipedia.org/wiki/Fresnel_integral"]Fresnel integrals[/URL] for a Numerical Analysis class. We have to use Romberg Integration to do this, and I suppose I am confused as to how I can graph this (I am confused when it comes to integrals.) I … | |
So far I have this as my main [CODE]#include <string> #include <iostream> # include <fstream> #include "money.h" using namespace std; int main () { ifstream infile; ifstream outfile; infile.open ("transaction.dat"); int precision = 6; int width = 20; if (infile.fail ()) { cout << "Opening input failed" << endl; } … | |
Hi; I have a Q/A based game which randomly selects questions that are stored in access file table. I have define a vector and a stdstream that takes no of questions as input. The no of records are 300 and I want the program to select only 30 questions but … | |
trying to make a tictactoe (in class) c++ program but i cant seem to get the board printed when i enter the 2nd set of numbers. if you see nay other mistakes please let me know ..... thanks in advance first time here :) [// [CODE]#include<iostream> using namespace std; const … | |
I am currently writing a program called Encoding and Decoding strings with the Enigma Class. This was a class assignment, but it already has been turned in, and I would like help (I am not looking for the work to be done for me) so I may learn from my … | |
hello, I am using visual studio 2008 with C++ (MFC) project and I want to add a reference to this project, I want to add an .exe file as a reference because this reference can converts the text to speech and i want that because my project must speak the … | |
Hi I'm attempting to copy a file to a buffer using the ReadFile Win API. It works fine for text files but for other file types, for example .exe, it only copies the first few bytes. I can't identify the problem. I would greatly appreciate it if somebody can help. … | |
Hi folks, C++ and Java are platform independent. It is for sure. Java is a resource hog. The learning curve of C++ is quite steep at start. What I'm going to use C++ is to build a platform independent software with sound and graphic integrated as well interactive. Would C++ … | |
Hello everybody. I want to make a piece of code that its main job will be to swap rows in a 2d char array. I wrote the following piece of code: [CODE]#include <iostream> using namespace std; void swap(char *s1, char *s2); int main() { char arr[3][10]; cout << "give me … | |
I need to make a towers of hanoi program using vectors. the code I came up with works fine without the vectors. I have no clue how to make it work with vectors. any help? thanks [CODE]#include <iostream> #include <vector> using namespace std; void towers( vector <int> &disks, int start, … |
The End.