49,761 Topics

Member Avatar for
Member Avatar for SCass2010

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 …

Member Avatar for SCass2010
0
1K
Member Avatar for sita12345

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 …

Member Avatar for Fbody
0
94
Member Avatar for ranejitendra

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

Member Avatar for ranejitendra
0
4K
Member Avatar for stereomatching

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

Member Avatar for stereomatching
0
158
Member Avatar for Kyle Willett

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

Member Avatar for Kyle Willett
0
179
Member Avatar for pwnerboy

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 …

Member Avatar for pwnerboy
0
1K
Member Avatar for Silvershaft

Hey all! I am interested in learning to use sockets. make client and server program. Where should I begin? Thanks!

Member Avatar for PriyankaMV
1
146
Member Avatar for dolfan55aj

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 …

Member Avatar for mrnutty
0
962
Member Avatar for corby

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 …

Member Avatar for corby
0
180
Member Avatar for MrEARTHSHAcKER

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 …

Member Avatar for vijayan121
0
78
Member Avatar for demroth

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 …

Member Avatar for demroth
0
3K
Member Avatar for coolbeanbob

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

0
54
Member Avatar for mc3330418

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 …

Member Avatar for mc3330418
0
82
Member Avatar for Thug_life

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 …

Member Avatar for Clinton Portis
0
100
Member Avatar for Taino

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

Member Avatar for mikrosfoititis
0
120
Member Avatar for Xaviorin

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 …

Member Avatar for Xaviorin
0
123
Member Avatar for Tom_Weston

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 …

Member Avatar for Xaviorin
0
366
Member Avatar for mcconnell_34
Member Avatar for thines01
0
99
Member Avatar for nubcoder

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 …

Member Avatar for nubcoder
-1
127
Member Avatar for R3AL

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

Member Avatar for R3AL
0
143
Member Avatar for momin90909

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.

Member Avatar for WaltP
0
271
Member Avatar for kusel1030

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 …

Member Avatar for kusel1030
0
689
Member Avatar for Labdabeta

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?

Member Avatar for Labdabeta
0
2K
Member Avatar for Thermalnuke

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 …

Member Avatar for Thermalnuke
0
180
Member Avatar for itzcarol

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 …

Member Avatar for Tumlee
0
249
Member Avatar for gameguy91

#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; }

Member Avatar for gameguy91
0
153
Member Avatar for gameguy91

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

Member Avatar for gameguy91
0
259
Member Avatar for vonbv25

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

Member Avatar for Schol-R-LEA
0
151
Member Avatar for begyu

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for pradiptart

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 …

Member Avatar for olivia123
0
209

The End.