48,986 Topics

Member Avatar for
Member Avatar for amirdragon

Hi everyone I am a C# programmer but recently I faced a problem which i guess it would be solved using C++ ( still not sure!!!) I want to have the list of data type definitions existing in native windows kernel module. I would be appreciated if anyone could give …

0
26
Member Avatar for vbx_wx

i have the following code: [CODE] HWND window; char name[MAX_PATH]; while(1) { window = GetForegroundWindow(); GetWindowText(window,name,sizeof(name)); strcat(name , "\n"); WriteToFile(name); } [/CODE] i just want to print it once,and if i open a new window,print that too,once....and so on.....and i dont know what condition to put to work corectly :(

Member Avatar for Ancient Dragon
0
145
Member Avatar for Fenlevi

Hi guys, In my lab I was given a source code and was tasked to write the function to compute the largest value of a vector, and a for loop to show how elements does the vector has.But the output is now right,it gives me the largest element is zero,and …

Member Avatar for MyrtleTurtle
0
139
Member Avatar for Falmarri

It's been about a year since I've used C++, and I'm having a weird error that I can't remember why it does this, or if there's actually something wrong. My destructor gets called twice when I declare my object via the first method, and only once (correctly) when it declare …

Member Avatar for webs1987
0
224
Member Avatar for aa_day90

I haven't got any luck finding why this program wouldn't work. Here's the code. [CODE]int main (void) { ifstream file; char *streamer = NULL; file.open("now.txt", ios::in | ios::binary); if (file.is_open()) { while (!file.eof()) { streamer = new char[33]; cout << "Prestream: " << streamer << endl; file.read(streamer, 32); cout << …

Member Avatar for aa_day90
0
83
Member Avatar for a4aadi

here is code[ [CODE]#include<iostream> #include<fstream> #include<conio.h> using namespace std; struct book_dtail { int copies; char title[50]; char author[50]; int year; char **bn; }; void main() { int size; ifstream indata; book_dtail user_book[5]; indata.open("file path to be added here"); for(int count=0;count<5;count++) { indata>>size; user_book[count].copies=size;//2D array initialized. user_book[count].bn=new char*[size]; for(int temp=0;temp<size;temp++) { …

Member Avatar for a4aadi
0
95
Member Avatar for hurricane123

I wanna know how 2 return string by using function for example if we want to check the lenght of string we use cout<<strlen("c") but how to use this by fuction

Member Avatar for webs1987
0
117
Member Avatar for atishvaze

hi i am totally new user in of vc++ i am doing a project on audio processing in vc++ there are basically four steps which i want to perform 1.reading a audio 2.playing a audio 3.converting the audio in 1-d array 4.playing the array back please help me in this …

Member Avatar for Software guy
0
91
Member Avatar for tajendra

If i have process P1 which contain two thread T1 and T2, then is it good to bind whole process to core C1 or To bind thread T1 to core C1 and T2 thread to C2 core. Which will give more performance ? If we assume C1 thread can consume …

Member Avatar for Banfa
0
164
Member Avatar for roclaes

how should I correct my code ? i get a "'myclass' : is not a member of 'classinform' " error : [code] #pragma once namespace classinform { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; public ref class Form1 : …

0
75
Member Avatar for elektro123

Hello! I have small problem. I have char array which contains e.g. "10010010100010110" and I want to read/write it from/to file in binary mode. How can I convert my char array to a group of bits and how to write/read it to/from file? I need something like this: 1. I …

Member Avatar for elektro123
0
226
Member Avatar for Asheem

Guys, in this program, we have a file by the name of asharray.txt, which is attached to this post, and we have three functions: 1.to read the file 2.to sort the numbers 3.to write to a separate file by the name of( array result.txt) Sp, here I faced some problems, …

Member Avatar for Asheem
0
231
Member Avatar for cblue

Does anyone know how to create circular linked list whose links are numbered from 1 to n specified by the user?

Member Avatar for jai verma
0
243
Member Avatar for gnarlyskim

I'm trying to clean up my coding a bit for a program I'm working on. Here's an example of my code (not my exact code, but I've adapted it to an example): [CODE]class Example { private: double* group; int number; public: Example() {group=new double[1]; number=0;}; Example(const Example& ex); Example& Example::operator=(const …

Member Avatar for gnarlyskim
0
125
Member Avatar for Anand111

How can i create a program that can continuously run immidiately when comp is logged in . This program should have to run as a process which can continuously check some conditions. Please kindly reply. [i]email snipped[/i]

Member Avatar for vijayan121
0
78
Member Avatar for sana zafar

Hi all, I m new to C++ and very desperately looking for some help in my code.Im trying to write a program that uses bisection method to find the root of a function.Im having problems as my results are not accurate enough and my function (f) does not produce answers …

Member Avatar for vijayan121
0
135
Member Avatar for lotrsimp12345

I plan on using the Bayesian method to try and solve the mastermind problem. The user will enter 4 numbers which represent the colors on the board from 6 different colors. After which the computer will randomly estimate the posterior probabilities for all events. ?Then continue with this scheme until …

0
73
Member Avatar for pinsickle

[CODE]class BinarySearchTree { public: BinarySearchTree (void); bool addRecursively // calls addRecursive (see private) (BinarySearchTreeNode* newAdd); bool addIteratively (BinarySearchTreeNode* newAdd); void writeRecursively // calls writeRecursive (see private) (ostream& outfile) const; void writeIteratively // if implemented, requires a stack - (ostream& outfile) const; // - see oop06 private: void addRecursively (BinarySearchTreeNode* currentRoot, …

Member Avatar for pinsickle
0
89
Member Avatar for Martje

Hi, I am trying to convert a char pointer to a normal char(somehow copy the strings from the pointer and pass it to the char) Here is a piece of example on what i want to do [code] #include <iostream> #include <windows.h> using namespace std; int main() { char *namen="Test"; …

Member Avatar for WaltP
0
100
Member Avatar for Fenlevi

[CODE]#include <vector> #include <iostream> #include <iomanip> using namespace std; typedef vector<double>row; typedef vector<row>Matrix; Matrix grade; void read_matrix(Matrix&grade,vector<string>&names); void display_matrix(const Matrix&grades,const vector<string>&names); void read_matrix(Matrix&grade,vector<string>&names) { int grades; cout << "Reading data into a Matrix " << endl; cin >>grades; if(grades== 0) { cout << "Making vector empty." << endl; grade.resize(0); } …

Member Avatar for WaltP
0
103
Member Avatar for TSaunders84

we are in a section were we are working with classes also with arrays my question is if you have an array of students how can you remove that student for the list by copying the other students for below up a slot.

Member Avatar for WaltP
0
75
Member Avatar for Reprise

In my program I am creating a class instance then writing it to a binary file. I do this several times so I have several instances of this class in my file. Then I want to access them individually, read them back into an instance in the program, change its …

Member Avatar for Reprise
0
232
Member Avatar for C++ Beginner

Problem: Course Grade Modification Write a program that uses a structure to store the following information: Name, idNum, tests, avg, and grade I got the most of the program completed so far, however I still need to do the average and grade, if anyone can assist me I would greatly …

Member Avatar for C++ Beginner
0
78
Member Avatar for i_luv_c++

hey guys i wrote a code for honework problem...the code works fine however everytime user puts more number than the static array it keep those number in the memory and later in the program if i do cout and cin it will ignore that and assign the number to the …

Member Avatar for i_luv_c++
0
110
Member Avatar for moqbel

[CODE] #include<iostream> #include<fstream> #include<string> using namespace std; void main() { //decleration ifstream source; ofstream target; char * box; int width, height, numlevel; string s; int amount= 100; //-------------------- source.open("1.ppm",ios::binary); while(source.fail()) { cout<<"can not open the file"<<endl; // to make sure the file is opened } source>> s; if ( s …

Member Avatar for moqbel
0
263
Member Avatar for hlmjohnson1981

Create a program that prompts the user for their first name, then displays it with asterisks between each letter. Do not include an asterisk in the beginning nor the end. For example, Sharon would be displayed as: S*h*a*r*o*n . Here is what I have so far: [CODE] #include <cmath> #include …

Member Avatar for Ancient Dragon
0
83
Member Avatar for zango

So I have one problem and I put in the code for you to see. This is the code that i am having problems with: [code]int main (void){ FancyDateClass myDateObj(24, 2, 2008); cout << "\n\n"; cout << "The date is "; myDateObj.displayDate(); cout << "\n\n"; cout << "The month for …

Member Avatar for Ancient Dragon
0
109
Member Avatar for bsdbum

Hello. This is my first posting so I will try to be as detailed and clear as possible. I am running into a problem with a method returning an incorrect value and I can't quite seem to figure out why. I'm building a Rolodex which is really just an object …

Member Avatar for bsdbum
0
425
Member Avatar for PDB1982

I keep getting the following error: [code] Error 1 error C2678: binary '+' : no operator found which takes a left-hand operand of type 'int' (or there is no acceptable conversion) [/code] and I can't figure out how to fix it...I believe it has something to do with the red …

Member Avatar for PDB1982
0
179
Member Avatar for robski

Hi all. Just a quick question for anyone who might know. Is there any way of setting up the entering of a character or number without having to press the return key after? For all options i input into my program when i run it i always have to press …

Member Avatar for Ancient Dragon
0
103

The End.