49,761 Topics
| |
Hello everyone. First, i'd like to introduce myself, would be very rude to just jump in here :) I'm Bojan, student, 1. year, Croatia, and in this semester i've got a class "Programming 1". Here we're doing C++ (in Visual C++). And the idea of the class is to make … | |
Hello. I'm a C++ newbie and am trying to make a functional console RPG game as a hobby project. The code I'm having a problem with allows the players to move through rooms, similar to an old text adventure game. I realize it's probably inefficient, but I've only been learning … | |
OK so most can guess I am a student just now learning programming and starting out with C++. I have tried many compilers and IDE's and have settled on Eclipse for now. I do not want to start a What compiler/IDE do you use, but I am trying to figure … | |
#include <cstdlib> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { string f, o, i, file_c, file_d; ifstream fin; ofstream fout; f = "in.txt"; o = "out.txt"; cout << "Input filename" << endl; cin >> i; file_c = i + f; file_d = i + o; … | |
I have been trying to concatenate two strings declared in the form of pointers i.e. [CODE] char* chars; [/CODE] But the program crashes... Here is the code: [CODE] char *chars1="ankit"; char *chars2="sameer"; char *temp; int i; for(i=0;i<len;i++) { temp[i] = chars1[i]; } for(int j=0;j<len2;j++) { temp[i] = chars2[j]; i++; } … | |
Hey, everyone, I am another student seeking help for a programming class. What I am having trouble with specifically is reading from a file. The program itself involves entering in some store products with information such as: product name, product ID, etc. After everything is entered, the program is supposed … | |
My problem is that i've got an input file which contains information about universities, contains string, integer, floating points types also... Here is the first three lines of the file, how could i for example sort it by institution name?? Each column is separated by the tab character... Please help … | |
fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory I'm using Visual C++ 2005 with MSDN. Can anyone help me figure out the problem? [code] Build Log Build started: Project: Login Server, Configuration: Debug|Win32 Command Lines Creating temporary file "c:\Documents and Settings\Matt\Desktop\eROSE2\Login Server\Debug\RSP00000160004664.rsp" with contents [ … | |
I have this little program that assign seat for ailine passenger, it's work, but I want to add so that it display the name of (passenger = seat number) so far I only got it to display the passenger name in the spot of that seat number. I try set_num … | |
hi every1 i also need help with my assignment im supposed to find the errors and explain how to correct it heres the program: //question 3a [code=cplusplus] #include <iostream> using namespace std; int main ( ) { int nrLuggagepieces; float mass, total mass; int averageMass; // initialize totalMass = 0; … | |
I am working on a program with function files and I am not sure how to ask this so this might be kind of interesting. We were given an input file that I saved to my desktop. This is all I did with it and I am not sure if … | |
Hello, Lets say i have an edit control in my program. When i run the program i can write some text in it. How can i save/convert the text that was written in the control to a CString variable ?(it should be "saved" by clicking on a button) | |
the title describes the problem. here's how the code looks like: [code]#include <cstdio> class example { public: class node { public: int value; node *left, *right; }; node *root; example (int a) { root=new node; root->value=a; } // HERE'S THE PROBLEM: void function (node *variable=root) { } }; int main() … | |
I'm new in assembly and was trying to get this program to work, it supposed to calculate the square root of any integer but i don't know how to load the ax into stack, get the square root and return the value to the c++ variable, that was the closest … | |
Guys hello, i`m a new member here [IMG]http://images.devshed.com/fda/smilies/smile.gif[/IMG] Hello to everybody...I need urgently help... I have an assignment for C++. "We have a collection of emails. This collection has emails from Linguist.org, these mails are legal. these are in a file called ling_filenames.txt. We also have a collection of spam … | |
i want to convert char array element into hexadecimal value. But the code i wrote is not giving the output as i expect. [code] unsigned char in[256]; void Text(const char *Buffer) { static char tempValue[256]; for(int i=0;i<=len;i++) { sprintf(&tempValue[i],"%02x", (unsigned char)Buffer[i]); in[i]=(unsigned char)tempValue[i]; cout<<"HexaValue"<<in[i]; } } [/code] this is not … | |
Can anybody tell that when Inline won't work though we have declared function as inline. i.e code replacement won't take place . | |
Hello, i'm stuck with a problem on binary search. I need to compare a string with an array of type string. It is changing the position from which the string should be read but z compare is not successful. here's my code. Any help would be appreciated. thanks in advance. … | |
i just wanted to make a program which reads 5 numbers then writes this 5 number. that's it but i couldn't. something's wrong and i couldnt find what is it. #include <stdio.h> void fun1(void) { int a=0,b=5,c=0; int d[5]; for(a=0;a<b;a++) { printf("%d\n",d[a]); } } int main() { printf("enter 5 numbers"); … | |
Hello! I need a help. I've got to make a program with insert and search function and I have to use to following. To create a database in which I will implement insert and search The part of code is given: [code] #ifndef CONTAINER_H #define CONTAINER_H #include <iostream> #include <string> … | |
please help to with this program by mainly using arrays and pointers ,... i need this program to check 2 matrix files "if they contain any character and if they contain cout<<"invalid"; " and to open them from .txt file Help with Code Tags cplusplus Syntax (Toggle Plain Text) [code] … | |
Hello, Attached are two codes. Please compile them and check the output. The question I have is that I am unable to understand why is it that the memory location allocated to tempmemcheck are 8bytes + the last memory location and not 4 bytes plus the last memory location. Similarly, … | |
Hi folks, I'm just learning C++ (using Borland C++ Builder) and I am having difficulty reading data from a text file created in Excel. I am trying to read the data into vectors which I can then use in a model that I am building. The problem is that I … | |
Hello, I have a function which calculates time for a specific operation and prints the time... However i want to call the time in another function and display its value... The code is as follows:- [code=c++]int encrypt() { double encryptTime,Add,sub,sft,mix; // add + sub + sft + mix calculations encryptTime … | |
Can anyone please tell me how to store contents of a text file after reading it into a 1D array buffer and then accessing each separate element of the paragraph? Please help | |
Hello, I have a statically linked library, which I'd like to convert to dynamically linked one. For that I'd have to export symbols. My question is what symbols should I export in case of the interfaces. Here is an example [CODE=C++] // ----- IA.h // Interface class class IA{ static … | |
I'm not really sure how to go about implementing these functions in my queue, any help is greatly appreciated! Edit: I just realized, I also have no idea where to start for the copy constructor [code=cplusplus] #include <iostream> using namespace std; template<class ItemType> class Queue { private: int front; int … | |
I'm having some trouble with dynamic memory allocation of a struct. The struct looks like this: [CODE]struct J { int w; int s; };[/CODE] During the execution of the program, the following line of code results in a crash, which when debugging was because of std::bad_alloc, which does not make … | |
Just a quick question, I am working with classes and I was trying to rename one as an array, ie: [code] addressType addresses[n];[/code] But I have decided not to make it an array. So is this a legal statement? [code] addressType addresses;[/code] Or does that only work for arrays? Thanks | |
Hey, i was just messing around and made a calculator and was just wondering if there was a way i could make it shorter? I'm not really bothered i just want to know? [CODE]#include <iostream> #include <conio.h> using namespace std; int main() { system("TITLE My Calculator Program."); system("COLOR 4"); double … |
The End.