49,761 Topics
| |
Hi, I current I have a vector <void*> that I need to populate with values, stored as char*. Is there a way to convert to void*, then back to char* whenever needed? I have tried casting and using static/reinterpret_cast but when I try to output (converting from void* back to … | |
Hi, main.cpp vector<Employee>e; e.push_back(Employee("Hawaii",100)); cout<<endl; e.push_back(Employee("Scotland",20)); cout<<endl; e.push_back(Person("Saga",30)); cout<<endl; Employee e1; //created an object sort(e.begin(),e.end()); e1.show(e); Employee.h bool operator<(const Employee& e1,const Employee& e2); Employee.cpp bool operator<(const Employee& e1,const Employee& e2) { return e1.getName() < e2.getName(); } With this code it is just sorting only the first 2 objects and displaying … | |
I am creating DLL using VC++ - Console application.. I am writing it for crating a new file... I am using Createfile function for this. but facing below error... error C2733: second C linkage of overloaded function 'CreateFileW' not allowed Below is my .CPP file from the project.. #include "stdafx.h" … | |
compiler : visual c++ 2005 os : win7 64bits [code] #define PARSE_AND_SERIALIZE_WRAPPER(HANDLE, VENDOR) \ template<> \ struct parse_and_serialize_wrapper<HANDLE> \ { \ template<typename Request> \ bool serialize_req(Request &request, std::string &serialized_msg, \ xml_schema::namespace_infomap &xml_namespace, boost::mpl::vector<serialize_query>); \ }; \ \ template<typename Request> \ bool parse_and_serialize_wrapper<HANDLE>::serialize_req(Request &request, std::string &serialized_msg, \ xml_schema::namespace_infomap &xml_namespace, boost::mpl::vector<serialize_query>) \ … | |
In my cs2 class we are covering simple lists very quickly. I was assigned to add some functions to a basic list class, and after much thought I can not understand how to solve the problem. Here is the assignment: [QUOTE] you will add the following methods: + removeNode(val : … | |
Here's my code: bigInt.cpp [CODE]/ // bigInt.cpp #include "bigInt.h" bigInt::bigInt() { int i; for(i = 0; i < SIZE; i++) //Sets all the values of digits to 0. digits[i] = 0; sign = true; numDigits = 1; error1 = true; overflowFlag = false; } bigInt::bigInt(const char temp []) { int … | |
Hey all! I am interested in learning to use sockets. make client and server program. Where should I begin? Thanks! | |
I have a Graph that I'm making using an adjacency matrix to hold edge values. The noEdge value is zero and all edgeweights are positive integers. I have to delete a node from this graph and I'm having trouble figuring out how to update the Adjacency matrix after the deletion … | |
im trying to overload the operator+= and use that to implement operator+ in my string class. i keep getting a segmentation fault when i try to evaluate something like s1 += s2 where MyString s1("");and MyString s2("hello"); any suggestions as to why this is happening? this is my operator+= function … | |
Hi, Is there any possible way to create program which'd take some data from net and store it in program memory ( some variable, irrelevant ), for example - currency list? If there's no way in console, what about using Borland Builder 6? I hope my idea ain't so absurd … | |
I am trying to write a lexical analyzer program that will read in input from a file and produce a formatted output. I need help as I am stuck. I am sure I am not passing the file stream, and the function parameters correctly. Do note some of the functions … | |
Help! Why am I getting the following error on line 100?? I don't get an error when I use storage in other places? error C2065: 'storage' : undeclared identifier [CODE]#include "utility.h" struct masterFile // master file record { int employeeID; string employeeName; string departmentID; int YTDhoursRegular; int YTDhoursOvertime; double regularPayRate; … | |
I have a student name, wins, losses. In that order in a txt file. I'm trying to read it in and them print it out, but i'm not real sure what I'm doing [CODE] #include <iostream> #include <fstream> using namespace std; const int MAX_SCORES = 50; ifstream infile; void report(int … | |
Hi i had to write the program that prompts the user for integer values. Place these values into an array. What i cant figure out is the following i will be highly thankful to you if you can help me on these [I]Compute Sum – add up all of the … | |
Hi, I am running an application and wish to add random outputs when the user answers correctly. example 1 + 1 = 2 cout << " great"; I wish to randomly cout << excellent or very good or fantastic as well. Thanks! This is my code: #include <iostream> #include <cmath> … | |
So new here to daniweb and just finished my first semester of programming 1 and I'm trying to do some extra curricular work to get me prepared for my spring semester. Would appreciate any and all help or suggestions anyone could give me. Here's the issue: So i was trying … | |
Hi, I'm wondering how to remove a specific part of a string.. [CODE] #include <iostream> #include <string> using namespace std; int main() { string str1 = "How,Are"; cout << str1; //remove the comma, and everything behind the comma! so the output would only be 'Are'. return 0; } [/code] Thank … | |
NEWB alert, lol. This was homework that I failed because i didnt turn it in on time. I didnt turn it in due to the fact that i took an online course, my book sucks and my instructor only checks his e-mail once a wk. that and i couldnt for … | |
my code: [CODE] ... DWORD WINAPI myGWTHPID(HWND hWnd, LPDWORD lpdwProcessId){ __asm { MOV EDI,EDI PUSH EBP MOV EBP,ESP JMP [DLLFunc] } } int main(){ hInst = LoadLibraryA("user32.dll"); DLLFunc = (DWORD)GetProcAddress(hInst, "GetWindowThreadProcessId" + 5); HWND hwn= FindWindowA(NULL,"Untitled - Notepad"); cout<<"Window handle: "<<hwn<<"\n"; DWORD pID; myGWTHPID(hwn,&pID); cout<<"Process id: "<<pID; getch(); return 0; … | |
I am making a calculator which shoul not use cmath.h. I was just thinking that how is it possible to calculate trigonometric functions without cmath.h. Please help me. Thanks in advance. | |
I'm trying to write a program that will read in a file to a 2-d array and find out how many groupings (blobs) of characters there in the file. It then uses a recursive function to delete the already counted blobs, to avoid recounting. The program compiles fine, but when … | |
I have a project that I have formatted for Doxygen. I use extra header files to hold extra classes. The thing is that Doxygen only generates documentation for the first header file. How do I get it to document all of the files I specify? | |
I am having trouble with my looping sequence in this program at the end of the program it will let the user choose if they would like to exit the program or start all over again and it exits for both chooses and sometimes it will continue on to the … | |
HI All, I am having a little difficulties here. Here is my requirements: Play the game of paper-rock-scissors. In main ask the user how many hands he/she wants to play. This must be an odd number, so you must validate this input to make sure the number is odd! After … | |
#include <iostream> using namespace std; int main() { int n1,n2,n3,n4,n5; cout<<"input number\n"; cin>>n1; cout<<"input number\n"; cin>>n2; cout<<"input number\n"; cin>>n3; cout<<"input number\n"; cin>>n4; cout<<"input number\n"; cin>>n5; if (n1>n2 && n1>n3) return 0; } | |
#include<iostream> using namespace std; int main() { int n1,n2,n3,n4,n5; cout<<"input number1\n"; cin>>n1; cout<<"input number2\n"; cin>>n2; cout<<"input number3\n"; cin>>n3; cout<<"input number4\n"; cin>>n4; cout<<"input number5\n"; cin>>n5; if(n1 < n2) n1 = n2; if(n1 < n3) n1 = n3; if(n1 < n4) n1=n4; if (n1<n5) n1=n5; cout << "The largest number is\n" << … | |
i can't find what's wrong w/ my program. the output is wrong when i type long names and names w/ less similar letters (sorry for my english i'm a filipino) [CODE]#include <stdlib.h> #include <iostream.h> #include <string.h> #include <conio.h> #include <stdio.h> char name1[20],name2[20]; int count1[25],count2[25],temp1,temp2,total; void flames(int num) { switch(num) { … | |
Hi, I would like to read a directory, and get all the files in that with some kind of sorting, let us say sort by timestamp. Can you help me, here is my code so far: [CODE] #include <stdio.h> #include <iostream> #include <sstream> #include <fstream> #include <cstdlib> #include <vector> #include … | |
Sir, Kindly tell me what is the library name for the c++ in linux. I know for c it id libc.so ,,similarly for c++ what is the library name and how can i get it for my linux. I wrote a simple c++ program and executed it is working but … |
The End.