49,761 Topics
| |
(c++) Ok so I understand how to use the system function, and how to output to a file. How do I pipe the output of say system("last") to a file? system() returns an int, so if I mystream << system("last") it will put an int in the file. I need … | |
| I am back this week with another homework problem. My array is not working like I thought it would. My brain is about to explode trying to comprehend what is going on. This code will compile but, it won't do what I want it to. The array is supposed to … |
Here we go, I am working on some code to store an IP address in an object. I have overloaded operators >>, <<, and == and they are working fine with 1 problem. I am supposed to be able to cin >> ip1 >> ip2 >> ip3; but after I … | |
ok, i want to know how to make a pointer in C++ e.g: i have the address 006587B8 the offset for the pointer is 18 and i want to make its value 1 006587B8 = Pointer 18 = Offset For Pointer 1 = Value I Want To Make The Address … | |
[B]Background:[/B] I need the user to type in an int "k" key for an encryption program. For the program to work right, the user entered int needs to be between 1-25. It can't be higher. The problem is if the user enters something other than an int, the program either … | |
When i compile this code i get a few errors (i guess are simple for you guys) [CODE]void WriteMem(DWORD MemOffset, DWORD DataPtr, DWORD dataLen) { { DWORD OldProt; VirtualProtect((void*) MemOffset, dataLen, PAGE_EXECUTE_READWRITE, &OldProt); RtlMoveMemory((void*) MemOffset, (const void*) DataPtr, dataLen); VirtualProtect((void*) MemOffset, dataLen, OldProt, &OldProt); } void EnableHack(BYTE* AddrToChange, BYTE* To, … | |
I get this error that "LINKER ERROR : SEGEMENT _TEXT EXEEDS 64K". this error does not come on compiling(ALT+F9) but it shows 25 such errors on running(CTRL+F9). I am using a turbo c++ 3 IDE. I am doing a school activity. The program user graphics mode. this error doesnt show … | |
im getting an error cannot convert 'int' to 'double' for argument '1' to 'double sort Array(double'.int)' while trying to debug code what does that mean here is another copy of my code now. [code] #include <iostream> #include <iomanip> using namespace std; // Function prototypes double sumArray(double[], int); double getHighest(double[], int); … | |
[B]RegQueryValueEx and ÌÌÌÌÌÌÌÌÌÌÌÌÌ !!!![/B] Does anyone know why my code gives me "ÌÌÌÌÌÌÌÌÌÌÌÌÌ" Here's the code. HKEY keyHandle; char rgValue [1024]; LPCTSTR regPath = "Volatile Environment"; LPCTSTR regReq = "USERDNSDOMAIN"; DWORD size1; DWORD Type; if( RegOpenKeyEx(HKEY_CURRENT_USER, regPath,0, KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS) { RegQueryValueEx( keyHandle, regReq, NULL, &Type, (LPBYTE)rgValue,&size1); } RegCloseKey(keyHandle); | |
Hi Everyone, I developed an application using MCI(Media Control Interface) in VC++ ... Actually i designed a media player .... It is able to play mpeg1, vob, dat and avi file format BUT I am not able to play mpeg2 format (with m2p or mp2 file extension).... CAN ANYONE TELL … | |
Hi I have a text file which has 4 heading which will constitute the number of columns and based on values an array has to be populated. To give a clear picture it is as: input text file looks like: heading1 value1 10 value2 10 11 heading2 value3 10 11 … | |
[code] #define _CRT_SECURE_NO_DEPRECATE #include <iostream> #include <fstream> #include <cstring> #include <cctype> #include <cstdlib> #include <ctime> using namespace std; const int MAXWORDS = 8000; const int MAXWORDLENGTH = 6; const int MINWORDLENGTH = 4; int nWords; void fillWords(char words[][MAXWORDLENGTH + 1], int maxwords, int& num); int playOneRound (int wordnum); void correct … | |
This program is supposed to show the adjacency lists that are built given the input pairs:: 0-2, 1-4, 2-5, 3-6, 0-4, 6-0, and 1-3 I am having trouble with the syntax of my code. Could someone please help? [code] #include <iostream> using namespace::std; int V; struct node { int v; … | |
I stumbled on this function that calculates #'s that are perfect, how ever I do not understand why it works. any one care to explain? [code] int perfect(int num,int den) { int rem = num - ((num/den)*den); if (rem==0) return(den); else return(0); } [/code] | |
I need help figuring this out. What I need is this:[LIST=1] [*]The section number, as a string [*]The instructor's name, also as a string [*]The number of students in this section, as an integer. [*]The student's scores for the test, as an array of integers. Declare this array to be … | |
Hi Frenz! Please go through the following program made for matrices:- [code=cpp] template <class T> class Matrix { private: int dim1;int dim2; T **mtx; public: Matrix(int a) { dim1=dim2=a; mtx=new T*[dim1]; for(int i=0;i<dim1;i++) mtx[i]=new T[dim2]; } ~Matrix() { delete []mtx; } Matrix<T> operator +(Matrix<T> M) { Matrix C(dim1,dim2); for(int i=0;i<dim1;i++) … | |
i need a function: readData() to read in scores from a file. I can open a file up, but not sure how to code it so input from the user opens any file. [code] int readData() { cout << "Please enter in the path to the student score file: " … | |
Hello, I've been creating a page in php that needs to invoke heavy calculation functions for which I've created dinamic extensions for linux (.so) in c++, but there's one problem I have in one of those functions, I need to modify an array passed to that function by reference and … | |
Unable to correct this [code] void main() { char string[20]; char *aString=string; function (aString); } void function(char *name) { cout<< "enter name"; cin >> *name; cout << name; } [/code] | |
Is it possible to create reports using Dev C++?.. If so can anyone suggest piece coding stuff to do this.. Thanks in Advance., Shiva | |
I got few problems in Process creation and IPC in Solaris using C++. This is my problem in a nutshell. --I do have main process ---> A (say) ---And I want to create child processes of A which are doing independent tasks. (say C1, C2, C3, ....etc) Interface of A … | |
[code] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<iostream>[/COLOR] [COLOR=#0000ff]using [/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]const[/COLOR][COLOR=#0000ff] int[/COLOR][COLOR=#000000] namesize=21;[/COLOR] [COLOR=#0000ff]void[/COLOR][COLOR=#000000] getName([/COLOR][COLOR=#0000ff]char[/COLOR][COLOR=#000000],[/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000]);[/COLOR] [COLOR=#0000ff]void[/COLOR][COLOR=#000000] main()[/COLOR] { [COLOR=#0000ff]int[/COLOR] index=5; [COLOR=#0000ff]int[/COLOR] count; [COLOR=#0000ff]char[/COLOR] names[21]; [COLOR=#0000ff]char[/COLOR] *aString=names; [COLOR=#0000ff]for[/COLOR](count=0;count<index;count++) { [COLOR=#0000ff]char[/COLOR] names; getName(*aString,index); cout << [COLOR=#800000]"You entered: "[/COLOR]; cout << &names; } } [COLOR=#0000ff]void[/COLOR][COLOR=#000000] getName ([/COLOR][COLOR=#0000ff]char[/COLOR][COLOR=#000000] names[][21], [/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000] index)[/COLOR] { cout << [COLOR=#800000]"enter a name: "[/COLOR]; cin … | |
[COLOR=#0000ff][code]#include<[/code][/COLOR][code=c][color=#800000]iostream>[/color] [color=#0000ff]using [/color][color=#0000ff]namespace[/color][color=#000000] std;[/color] [color=#0000ff]consta[/color]code][color=#0000ff]nt[/color][color=#000000] namesize=21;[/color] [color=#0000ff]void[/color][color=#000000] getName([/color][color=#0000ff]char[/color][color=#000000],[/color][color=#0000ff]int[/color][color=#000000]);[/color] [color=#0000ff]int[/color][color=#000000]main()[/color] { [color=#0000ff]int[/color] index=5; [color=#0000ff]int[/color] count; [color=#0000ff]char[/color] names[21]; [color=#0000ff]char[/color] *aString=names; [color=#0000ff]for[/color](count=0;count<index;count++) { [color=#0000ff]char[/color] names; getName(*aString,index); cout << [color=#800000]"You entered: "[/color]; cout << &names; } } [color=#0000ff]void[/color][color=#000000] getName ([/color][color=#0000ff]char[/color][color=#000000] names[][21], [/color][color=#0000ff]int[/color][color=#000000] index)[/color] { cout << [color=#800000]"enter a name: "[/color]; cin >> names[index]; } … | |
I am working to add some simple user input checking into my program; there are three (3) int choices from a menu-- 1, 2, or 3. The user must choose one of these. I am able to check whether or not the input is 1, 2, or 3-- but I … | |
hi members...please help me about this code...the sum code is like the attachment below... | |
I am writing a MFC application and would like to change the font size of some of the static text. So I use the following. [code=c] CFont m_font; m_font.CreatePointFont(120,"Times New Roman"); m_Test.SetFont(&m_font); m_Test.SetWindowText(strTest); [/code] Now my question is, how to I get the layout editor in Microsoft Visual C++ to … | |
I have just started C++, i have problem in understanding virtual functions. can anybody tells me what are v.f. and most important what is there importance in C++. Thanks | |
Hello there. This is obviously my first post on DaniWeb, as I just found the site in searching for a solution to my issue. I've read over the site rules, as well as the forum rules regarding homework help. Let me start out by saying I am [U]not[/U] looking for … | |
I'm having a hard time generating a "secret word" that is random. I'm taking a random word from the wordList array, and using it in the playOneRound function. Here is part of my instructions: [code] Using wordList[wordnum] as the secret word, this function plays one round of the game. It … | |
Hi everyone, av been trying to come up witha program that will tell if a string is a plindrome.This wat i did and i can't realise the error; [code] #include<iostream> #include<string> using namespace std; int main(){ string s; string s2; getline(cin,s); s2=s; string::iterator pos; string::iterator pos2; bool check;check=true; for(pos=s.begin(),pos2=s.end()-1,pos!=s.end(),pos2!=s.begin()-1,pos++;pos2--;){ if(*pos!=*pos2){ … |
The End.