49,766 Topics

Member Avatar for
Member Avatar for mathueie

Hi, I am using ubuntu linux. I am trying cpu utilization of our software. How to use iostat in c++ program.

0
80
Member Avatar for Jacky1

I need a way to send email through smtp server ssl secured Programming Language: C++ Platform: Windows XP I need something doesn't involve visual studio Thanks in advance!

Member Avatar for William Hemsworth
0
230
Member Avatar for stonerain

[CODE]int C[10][20]; int * mmatrix (int A[ 10 ][ 5 ], int B[ 5 ][ 20 ]) { int i, j, k; for(i = 0; i < 10; ++i) for(j = 0; j < 20; ++j) { for(k = 0; k < 5; ++k) C[ i ][ j ] += …

Member Avatar for Salem
0
1K
Member Avatar for scuzzo

I need to output the first five lines or the last five lines of a .txt file the user provides while using switches in a command prompt. I've got it other than printing the lines to the screen. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; const int …

Member Avatar for NathanOliver
0
93
Member Avatar for Lukezzz

I am reading a .txt file line by line and when the line in the file is "Hello1", I want to Replace that Line with "Hello2" but I dont get that to work. I think I miss something out here [code] //Save this emailadress to the RouletteDataBase file String Path …

Member Avatar for landonr
0
274
Member Avatar for daviddoria

I was looking at this: [url]http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18[/url] I don't understand [code] File f = OpenFile("foo.txt"); [/code] It seems like File is one class, and OpenFile is a separate class, so how can you assign an OpenFile to a File? Also, is it necessary to have this second class? Why not something …

Member Avatar for Ancient Dragon
0
293
Member Avatar for BlackStar

[ICODE] #include <iostream> #include <cstdlib> using namespace std; struct A { A *B; }; struct C{ C*D; }; int main() { A * Z = new A; C * Y = new C; Z = Y; cin.get(); return 0; } [/ICODE] it says cannot convert Z to Y in assignment.

Member Avatar for NathanOliver
0
100
Member Avatar for bmcutler011

[code] #include<iostream> #include<fstream> #include"d_nodel.h" using namespace std; int main() { dnode<double> *listA = new dnode<double>; dnode<double> *listB = new dnode<double>; double sz1, sz2; int val1; //first set of integers int val2; //second set of integers ifstream inFile; //declares the inFile ofstream outFile; //declares the outFile //Read in a file to …

Member Avatar for NathanOliver
0
143
Member Avatar for lqdo

hello all, I'm getting some unexpected behavior from the ifstream object when using the open method. im reading the following characters from a text file: [CODE] ############### # #X# # # ### # # ### # # # # # # # ## ## # # # WWWW###WWWW # # …

Member Avatar for NathanOliver
0
131
Member Avatar for musique

What is wrong with my sorting function? I am trying to put numbers in ascending numbers. [code] void sort(int array[], int numts) { int lowIndex, lowest; for (int count = 0; count < (numts-1); count++) { lowIndex = count; lowest = array[count]; for (int index = count + 1; index …

Member Avatar for musique
0
254
Member Avatar for NathanOliver

hi i have a very large array that i want to populate but i don want to run the for loops every time so i thought i would right a program to output text to fill the array and was wondering if this would work. the array is [icode] int …

Member Avatar for NathanOliver
0
107
Member Avatar for rahul8590

i am working on my project which is on regeression of lines . well i have been successful in fitting a straight line to the given set of coordinates . since i have come so far after a lot of striving , i have been a bit exhausted on writing …

Member Avatar for Salem
0
672
Member Avatar for waldchr

After much frustration of trying to figure it out on my own, I am finally ready to admit that I need help. Does anyone know how to compile allegro 5? (or better yet have a precompiled version I could get my hands on) I have tried many tutorials and none …

Member Avatar for tux4life
1
636
Member Avatar for daviddoria

To redirect clog, I have been using this: [code] std::streambuf* clog_save; std::ofstream ofs; clog_save = std::clog.rdbuf(); ofs.open(LogFilename.c_str()); std::clog.rdbuf(ofs.rdbuf()); cout << "Test cout." << endl; std::clog << "Test log." << endl; std::clog.rdbuf(clog_save); ofs.close(); [/code] However, it seems like bad "code reuse" practice to have to put this in every program I …

Member Avatar for ArkM
0
177
Member Avatar for olejl

I am trying to learn some c++. To do this I have chosen to write an emulator. I had it up and running, but decided to try to make a better architecture. I have a strange problem that I don't understand. If I compile the following code (Visual C++ 2000 …

Member Avatar for ArkM
0
622
Member Avatar for therealsolitare

Hey everyone, I've been getting my rear end kicked by this homework assignment. We were given the task of writing up a command line version of Othello (Reversi) in a higher level language, which I chose C++ to do so in. My C++ version of the code is working great, …

Member Avatar for Salem
0
6K
Member Avatar for saadjaved14

Hey... ok before i start i want to say that i'm not a very good programmer... and i'm new with this... and i got a project that i have to submit in 2 days so i badly need help!! ok the problem is: I'm using binary file handling, a code …

Member Avatar for ArkM
0
106
Member Avatar for U_A_G

so we are starting arrays and our task is to go back to our assignment 2 (functions) and he wants us to run the program using arrays. im pretty stuck and have no clue what to do. [B]heres how assignment (functions)2 looks[/B] [code] #include <iostream> using namespace std; void getEmployeeData …

Member Avatar for VernonDozier
0
128
Member Avatar for weary01

hi there, i do hope someone can help with my delima. yes this is homeowork but i am 80% through my program and only wish to get some guidance on my program. my program has a number of things it has to do and one the things i am having …

Member Avatar for NathanOliver
0
116
Member Avatar for bunnyboy

Hello! I am making a postfix calculator and I want to add in some equation integrity checking. Everything seems to work ( it needs to be done some little improvements, but overall it is working), except when I am checking for the blank spaces the program do not work the …

Member Avatar for bunnyboy
0
161
Member Avatar for pczafer

how im gonna loop menu if option not 1 or 2 ??? [CODE]void display( ) { int option; system("cls"); //clear screen cout<<endl<<endl; cout<<"\t * Display Menu *\n"; cout<<"\n\t1. Display For Certein Date"<<endl; cout<<"\t2. Display All Appointments"<<endl; cout<<"\nEnter Option Number: "; //Enter option cin>>option; cin.get(); switch ( option ) { case …

Member Avatar for tux4life
0
187
Member Avatar for Sky Diploma

As i have written Atoi(); Now i have written Itoa. Here I have used a method of getting the last digit stroring it in an array and then reversing the array to get the required answer. I look forward for Improvements in this code. [CODE=C++] /**************************************************************************** Function Name:: itoa(int ,char …

Member Avatar for Sky Diploma
0
544
Member Avatar for colesefini

Im currently doing a project in QT and when I compile my project with my header/source files that i created, I get this "error: expected constructor, destructor, or type conversion before ‘->’ token ". Essentially i've created my own classes outside of QT and my objects work fine etc but …

Member Avatar for tux4life
0
65
Member Avatar for bilbatori

Hi, I've been trying to identify the error in this code of insertion in a 2-3 Tree. I do know its something with the search function...Can some one figure out whats wronge with the code?? [code=language] bool Two3::Insert(int val) { int x=val; bool done=false;//inserted or not?? if (IsEmpty())//empty tree creating …

0
82
Member Avatar for frossie

for example the sentence in the text file is "daniweb offers the best solutions for C++. the website is www.daniweb.com." i have the user to search the word "daniweb". by using ifstream to read word by word, this is part of my codes [CODE] ifstream file ("lines.txt"); string word; bool …

Member Avatar for rahul8590
0
105
Member Avatar for moteutsch

How can I clone an object in C++, so it is a seperate object, but exactly the same as the original? Thanks, - Moshe

Member Avatar for moteutsch
0
79
Member Avatar for timb89

i want to make a prgoram that will read in a set of numbers and determine whether or not they are prime numbers, this is what i got so far any ideas? [code] #include <iostream> #include <queue> #include <vector> using namespace std; int main() { queue <int> input; queue <int> …

Member Avatar for timb89
0
75
Member Avatar for sinapse

I have this problem to solve for preparing for the olympiad and i'm not quite fond of the functions so that i want to do it classically but i find it harder.Here it goes: "During a desert operation a group of soldiers were lost from different squads.After the storm passed …

Member Avatar for Salem
0
156
Member Avatar for willydlw

my makefile: [code] DRIVER_SRC = PumaDriver.cpp PumaBody.cpp PumaMotor.cpp base_manipulation.cpp serialPort.cpp DRIVER_INC = PumaDriver.h PumaBody.h PumaMotor.h base_manipulation.h serialPort.h silvermax_commands.h All: $(DRI_SRC) $(DRI_INC) g++ -Wall -Wextra -g3 -fpic `pkg-config --cflags playercore` -c $(DRIVER_SRC) g++ -Wall -Wextra -nostartfiles -shared -rdynamic -o libPumaMotorDriver.so PumaDriver.o PumaBody.o PumaMotor.o serialPort.o base_manipulation.o install: cp *.so /usr/local/lib uninstall: rm …

Member Avatar for Salem
0
190
Member Avatar for Lukezzz

Hi I wonder how it will be possible to get the current date and time. I have looked around and there are many different ways to retreive this. I wonder what could be a good way to do that. As for now, I would like to return a string for …

Member Avatar for ArkM
0
103

The End.