49,761 Topics
| |
Ok I have my structure defined in my main function. And the I need to send an array of structures to a function as follows: [code] int fillStruct (ifstream& fin, ROPES ropes[MAXROPES], int n) int main() { struct ROPES { members }; return0; } int fillStructs (ifstream& fin, ROPES ropes[MAXROPES], … | |
I have an assignment in which I have to create a 16-byte float, allocating bits to mantissa, exponent, sign of mantissa and sign of exponent at my own discretion. I have planned it to be as follows - Bits Purpose 1 Sign of mantissa 2 – 32 Mantissa 33 Sign … | |
I have been programming a compressor based on lz for my school project.When i used fixed block sizes there were no problems but now when i started using variable block sizes it crashes.The compression takes place without much problem but decompression crashes and debuggers does not report any error. Uncompression … | |
Hey, I'm working my first program that includes structures. For some reason though I have having errors with my getline. [code=cplusplus] inFile.getline( studentar, 20 ); [/code] My getline is being used in a function, so I don't know if that effects anything. The studentar array is declared as type student … | |
Do i still need to append? and do i get the string break. i try cannot only the first line break. how are you? I am fine. What about you? I fine too! the txt file is : How are you? I am fine. What about you? I fine too! … | |
I need to write the while loop to terminate with a '|' character program does not terminate correctly when using two cin numbers in the same line or even on separate lines (i.e. cin>>num1>>num2;) when the program does terminate with ^Z it just scrolls a long list of the last … | |
I'm having a problem with cin.get(). I'm prohibiting the user, that he can only enter 5 keys. and each key does something, like a MENU. Press 1, if you want this, etc. [ICODE]char choice[5]; cout<<"ENTER YOUR CHOICE"<<endl; cin.get( choice, 5); switch (choice)[/ICODE] Okay, when I run this, the compiler gives … | |
Hey guys, With this defintion: sss.hpp [code=cpp] #include <fstream> #include <string> #include <map> namespace sss { using namespace std; class node { public: multimap<string, string> values; multimap<string, node> children; string &value(const string name, int index = 0); node &child(const string name, int index = 0); //... }; typedef pair<string, string> … | |
Hi please can anyone run this code for me in Linux .. i want to know what's the output [CODE=c++] #include <stdio.h> #include <unistd.h> #include <sys/types.h> int main(){ for (i = 0; i < 3; i++) { if (fork() != 0) { printf("ONE"); if (fork() == 0) { printf("TWO"); } … | |
hi all, im trying to write contact info(name & number)from a file to the sim, in VC++ for Windows Mobile 6.0..iam unable to do this using the SimWritePhoneBookEntry()...can u guys plzzz suggest an alternative strategy.. thnksss | |
hey everyone need some help with a little homework assignment i need to make a program where a user is trying to book a seat on an airline in either first class or coach and if the seat that the passenger has choose is taken it either gives him another … | |
Hi I'm having a problem with this piece of inheritance code. When compiling it displays this error " 'getAverage' : is not a member of 'Person' " but shouldn't the casting overcome that problem? Do i really need to have a virtual function in "Person" for this to work? Thanks … | |
In this code : [CODE] #include <iostream> using namespace std; class Singleton{ private: Singleton(){} public: static Singleton* getInstance(); void myFunction(){ cout<<"\nmyFunction() called.."; } }; Singleton* Singleton :: getInstance(){ static Singleton* obj = NULL; if(obj == NULL){ cout<<"\nCreating new instance..."; obj = new Singleton(); cout<<"\nReturning instance..."; } else{ cout<<"\nan old instance … | |
hi, I am using FindFirstFile() and some times it is setting a error code of 317 (ERROR_MR_MID_NOT_FOUND 317 (0x13D)) Can anybody let me know what could be the reasons behind such an error. Thanks in Advance, Madhu | |
hi everyone.. i have a face recognition project to do in any language.. i have no clues on how to begin this.. can anyone plz send me an algorithm on face recognition using neural networks?? thanks | |
-------------------------------------------------------------------------------- Hey all. I'm a newbie at C++ and hope that you guys can guide me along. I recently got assigned a project and is needed to code it in C++, which I have almost zero experience with, so bear with me. =) I need to delete 3 log files … | |
Hello, I typically hang out in the C# forum, however I hope someone here can help. I am converting a C++ program to C#, and I need to know how to handle a couple things: IOW I know almost nothing about C++, and this code is coming from a non … | |
Hi everybody I am working on a String project for my class and I'm stuck on this swap function. This is what my professor has in his "tests" : [CODE]void test_swap_first_shorter() { // Setup fixture string foo("foo"); string barbar("barbar"); // Test foo.swap(barbar); // Verify assert(foo == "barbar"); assert(barbar == "foo"); … | |
I was trying to create a program that simulates tossing a coin to a user specified number of times and then say how many times heads appeared. However when i run my program it only seems to be looping once. [ICODE]//generates a random number 1-10 int rdom_gen() { srand((unsigned)time(0)); int … | |
okay, so I'm a little lost on how to use selection sort and i/o files for this project. the program is supposed to sort a list of first and last names into alphabetical order. here's the catch. each name has a GPA that goes with it. so not only do … | |
I made this small C++ program, and it won't compile. Please if someone can help me to fix these 2 errors: error C2059: syntax error : ';' error C2059: syntax error : '}' The text is not in english, but it doesn't metter, just these 2 syntax errors so it … | |
I stumbled upon another what I think is initializer, like int and char, named [B]HANDLE.[/B] It's also used when creating an application, I've browsed the net and found that it is a sort of pointer to an object that can change without me knowing it... eh... It wasn't really that … | |
[code=cplusplus] #include<iostream> #include<iomanip> #include<fstream> using namespace std; const int N = 20; // file declaration and open ifstream inFile; ofstream outFile; /* need to open files here */ //function prototypes void initialize(int& zeroCount, int& oddCount, int& evenCount); void getNumber(int& num); void classifyNumber(int num, int& zeroCount, int& oddCount, int& evenCount); void … | |
Hello I have a C++ project A which has to use heather/source files of project B. When I do include "B.h" then B's heather can't be seen because B and A are in a different sub-folders of the same folder.What can I do thank you | |
Hi! I am writting an windows form application in Visual C++ .NET 2003 and have an issue. When a user makes a change in the datagrid, how can I detect that a change has been made eithor with the datagrid or the underlying dataset? Also how can I identify the … | |
I have a problem with this code given below when i compile it without pointers it easily runs i want to run it by using pointer it gives me erro can any body runs the programme with pointers. when i compile this without pointer it runs #include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> … | |
Hi i am trying to find a good C++ tutorial to help get me started with programming. Does anyone know of a good one? | |
Hi I have two questions? 1-Is the quality of a picture related to its number of pixels?(I know its not related to c++) 2-Is it possible to work with individual pixels of a picture via c++? thanks | |
Hi there, i have an assignment, and i need to create a monthly expenditure. I have managed to get alot done, a fully functioning menu and all the functions. Im stuck when it comes to deleting an entry I have been using structured arrays to store data, ive posted all … |
The End.