49,761 Topics

Member Avatar for
Member Avatar for ellimist14

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], …

Member Avatar for ArkM
0
107
Member Avatar for pranjalkumar

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 …

Member Avatar for nucleon
0
136
Member Avatar for binamy1

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 …

Member Avatar for binamy1
0
138
Member Avatar for lancevo3

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 …

Member Avatar for lancevo3
0
106
Member Avatar for snoopy198520

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! …

Member Avatar for snoopy198520
0
128
Member Avatar for deedub

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 …

Member Avatar for tux4life
0
2K
Member Avatar for BlackStar

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 …

Member Avatar for Narue
0
115
Member Avatar for Clockowl

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> …

Member Avatar for ArkM
0
91
Member Avatar for DREAMER546

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"); } …

Member Avatar for Nick Evan
0
145
Member Avatar for vicky_menonsky

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

0
44
Member Avatar for elbashamoe

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 …

Member Avatar for tux4life
0
102
Member Avatar for Psykocyber

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 …

Member Avatar for Psykocyber
0
126
Member Avatar for abhi_elementx

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 …

Member Avatar for MrSpigot
0
99
Member Avatar for sunshyne23
Member Avatar for ithelp
0
80
Member Avatar for techmaddy

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

0
42
Member Avatar for harrykokil

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

Member Avatar for ithelp
0
109
Member Avatar for burger87

-------------------------------------------------------------------------------- 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 …

Member Avatar for burger87
0
136
Member Avatar for JerryShaw

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 …

Member Avatar for JerryShaw
0
268
Member Avatar for RizzLinux1388

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"); …

Member Avatar for jephthah
0
200
Member Avatar for trickiscool

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 …

Member Avatar for trickiscool
1
178
Member Avatar for aerobama

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 …

Member Avatar for siddhant3s
0
210
Member Avatar for viki0077

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 …

Member Avatar for waldchr
0
166
Member Avatar for ShadowScripter

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 …

Member Avatar for ShadowScripter
0
104
Member Avatar for southernd0529

[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 …

Member Avatar for jephthah
0
328
Member Avatar for booker

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

Member Avatar for booker
0
94
Member Avatar for DaveD3

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 …

0
54
Member Avatar for sharensla

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> …

Member Avatar for JugglerDrummer
0
175
Member Avatar for Nickair

Hi i am trying to find a good C++ tutorial to help get me started with programming. Does anyone know of a good one?

Member Avatar for tux4life
0
101
Member Avatar for massivefermion

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

Member Avatar for ArkM
0
117
Member Avatar for bolx

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 …

Member Avatar for bolx
0
140

The End.