51,593 Topics

Member Avatar for
Member Avatar for DdoubleD

Can anyone tell me how to get my blocks of code to automatically indent when I place the final closing brace--"}". This works fine when I am coding in C# and I know there must be a way to enable this feature for CPP source documents.

Member Avatar for DdoubleD
0
143
Member Avatar for trikker

I'm having trouble overloading >> in a fairly specific manner. When the program reads from a file, I want it to read the data into multiple classes. However, you can't pass more than 2 arguments to an istream overload. I've fiddled around with making one class a base class of …

Member Avatar for GDICommander
0
146
Member Avatar for BOONISRIDHAR

Hi am new to Java and am developing a multi agent application using Jade. I have coded 1 agent using Java and the other agent using vc++. My problem is communication between java and vc++. 1) I need to run the vc++ program within the java program for which i …

Member Avatar for BOONISRIDHAR
0
79
Member Avatar for vivekarora

Hello Friends, Generally, we have pure virtual function without body, but C++ does allow to write pure virtual function with body. Can anyone suggest any use-case where we need to write pure-virtual function with body? Regards, Vivek

Member Avatar for vivekarora
0
188
Member Avatar for crys0011

Hi everybody, I'm an engineering student. Hee i would like to discuss about some basic and simple C++ interviews questions. I thnk the persons interested in it will participate. Ok can i ask one question? What are the differences between C language and C++ language?

Member Avatar for mrnutty
0
127
Member Avatar for AssaultM16

So I am trying to use multiple source files for my text based game. In Code::Blocks in doesn't even compile it says " cannot find -lfunctions.h". In Dev-C++ it compiles but the function doesn't work properly Here is the code Main.cpp [CODE]#include <iostream> #include <string> #include <fstream> #include "functions.h" using …

Member Avatar for AssaultM16
0
100
Member Avatar for amol14007

Hi, A specific set of range <10,20> <20,30> <30,40> <40,50> i have series of numbers in a buffer; say.. 11 14 19 23 28 45 49 is present in char* noInBuff; Every time if the number falls in specific range for the first time then i have to replace it …

Member Avatar for VernonDozier
0
286
Member Avatar for logine

please help me to have a program that will compute for n! (n factorial) which is the product of all numbers from 1 to n.

Member Avatar for mrnutty
0
93
Member Avatar for almasari

Task: Write a program to grade a test and print the student’s score. The questions are in multiple choices form. There are 25 questions given in the test and each question has 4 choices; A,B,C and D. Assumed that there are 20 students taking the test. Each answer is stored …

Member Avatar for mrnutty
0
93
Member Avatar for rhoit

I was writing the program for revised simplex method in devc++ (windows) and it was working fine... Now I am using ubuntu and trying to run the same program.......(with few changes) i compiled successfully using g++ but when i run it run but showed error some what like: [QUOTE]rhohit@Trashbox:~$ g++ …

Member Avatar for Salem
0
206
Member Avatar for ScienceNerd

What's wrong with my if else then function? It complies fine (Dev C++) but it doesn't function properly. It displays all the messages together. [code] void data(void) { cout<<"How many hours did you work: "; cin>> total_hours; cout<<"How many days did you work: "; cin>> days; return; } void process …

Member Avatar for tux4life
0
143
Member Avatar for poncho4all

Ok i have a calculator program, but it can only do positive numbers, can anyone point me in the direction to make it get negative numbers also? [code]#include <iostream> #include <iomanip> using namespace std; struct Node{ float number; Node *next; }; Node* push(Node *stack, float data){ Node *utility; utility = …

Member Avatar for Salem
0
118
Member Avatar for Stefano Mtangoo

Hi all, I have been using PNG files for icons and they are good. But I want now to use xpm as they can be included just as I include header file. How do I do that? Any free tool?

Member Avatar for Stefano Mtangoo
0
116
Member Avatar for shadwickman

Hello, I've just recently tried to make a class template whose constructor should be able to accept a variable amount of arguments of the class passed to the template. I have something like this, with the prototype inside the class definition, and the actual implementation of the constructor defined outside: …

Member Avatar for shadwickman
0
167
Member Avatar for namehere05

I have the following code and it wont compile, it says no matching function for call to `autop::autop(autop)' at this part [CODE]autop j = f();[/CODE] I don't understand why the copy constructor wont accept the autop copy Im sending it. [CODE]#include <iostream> using namespace std; class autop { public: autop(int …

Member Avatar for namehere05
0
174
Member Avatar for gretty

hello I am reading a text file & trying to store some information into a 2d array. [B]My problem [/B]is when I go to store a piece of data into the 1st row (1d area ?:P) I get this error error: [QUOTE] incompatible types in assignment of `float' to `float[25]' …

Member Avatar for mrnutty
0
123
Member Avatar for muzhe

hi, I am wondering if you can give me some ideas about below: I've a program which uses 3 dimention cartesian co-ordinate system, I've written a program which generate input files for that program based on the 3D co-ordinates. However one thing that I dont get hold of is how …

Member Avatar for muzhe
0
170
Member Avatar for metalclunch

Hello, it's Metalclunch here, and I've got a pretty simple and straightforward question: How would one implement a scripting language? Prefferably Python. Thing is, I'm pretty much a beginner, I know about the if, else if, for, while statements and functions. Okay. Here goes. I've made a very simple text-based …

Member Avatar for Tigran
0
163
Member Avatar for trikker

This program reads information from a text file with an istream_iterator and initializes a vector with the data. Everything has been working fine, but when I created a constructor for the class to use for insertion into the vector, I get a compiler error involving the istream_iterator. [code] #include <vector> …

Member Avatar for DdoubleD
0
185
Member Avatar for catchmrbharath

The question is Let's consider a triangle of numbers in which a number appears in the first line, two numbers appear in the second line, three in the third line, etc. Develop a program which will compute the largest of the sums of numbers that appear on the paths starting …

Member Avatar for siddhant3s
0
261
Member Avatar for kelvinnvl

I'm recently doing an assignment for fraction problem. I've implemented classes for the programme to accept fractions. And i've overloaded operator +, -, *, / and ==... But here is some strange thing. Before that i show some of my code here regarding operator -: [CODE]Fraction operator-( Fraction a, Fraction …

Member Avatar for siddhant3s
0
170
Member Avatar for scantraXx-

[CODE] if (user_input == 1) { dict.open("dict.txt"); cout << "Enter word "; cin >> word_check; toLower(word_check); vector<string> lines; string line; if (dict.is_open()) // if the dictionary is open { while (getline(dict,line)) { lines.push_back(line); } if (binarySearch(lines, lines.size(), word_check) != -1) { cout << word_check << " is in dictionary" << …

Member Avatar for tux4life
0
195
Member Avatar for basketball4567

I need to read information from a text file into a struct array. Im writing a program to make a list of favorites that the user will input. When they close the program, the array will write to a file. The next time the program is ran, i need to …

Member Avatar for Ancient Dragon
0
493
Member Avatar for johndory

Hello, I was wondering if there is a tutorial on binomial heaps on this site. if not, i would appreciate it if someone can post any links that are helpful on binomial heaps. All the text books i have do not have anything on binomial heaps. some do not even …

Member Avatar for jainrani
0
142
Member Avatar for plongx211

hi, can you help me in making my program ,employee log system program and it is password protected program ^_^ .....

Member Avatar for tux4life
0
105
Member Avatar for DavidDan

Hello! First post so I'd like to say hello to everyone :) So I've got this code here, I am very new to C++ and going through the basics, and I am creating a program that will tell the user when he/she is born. So the user puts his/her age …

Member Avatar for tux4life
1
226
Member Avatar for seakayaker

I wonder if anyone knows how I can call a function if a document of my type is double clicked to launch my application? I have made my document types associated with my application but it only launches my program when those are double clicked. I want to read in …

Member Avatar for Ancient Dragon
0
95
Member Avatar for bernadlosini

question given like this The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, .... Formally, it can be expressed as: f ib0 = 0 f ib1 = 1 f ibn = f ibn−1 + f ibn−2 1) Write a C program using the fork() …

Member Avatar for namasteall2000
0
420
Member Avatar for power_computer

/facepalm Ok, so I have to make a program upon startup it has to read from a said file which looks something like this Song Name Artist Genre Track Time That is one block of the array, their is a max of 10. Ive been googling and searching the forums …

Member Avatar for cgeier
0
197
Member Avatar for infinity16

[I]<< Forked from [url]http://www.daniweb.com/forums/thread40942.html[/url] >>[/I] [QUOTE=Narue;196586]>But after printing the last word, it just hangs like as if expecting another string too. Probably because it's expecting another string. A newline is whitespace too, and unless you're terminating the loop with Ctrl+Z (or a read error occurs), it'll just keep asking you …

Member Avatar for mrnutty
0
103
Member Avatar for bynaridoom

Ok, what I'm trying to do is have the user enter a command at the prompt, and on the right command a function is called. Here's my code: [CODE]#include <iostream> #include <stdlib.h> void functionCall() { std::cout << "function successfully called"; } int main() { char userInput [128]; std::cin.getline(userInput, 128); std::cout …

Member Avatar for bynaridoom
0
124
Member Avatar for ellla

typedef std::list<list*> List; Can you tell me how to enter inside the list,if I want to know number of contacts which it consists..

Member Avatar for mrnutty
-1
134
Member Avatar for krayzeeben

Hi, i've had experience making counting programs in the iostream and now i'd like to make something useful to me. I play a web browser-based game called Neopets, and i often refresh 500 times a day there to encounter random events. Eventually, my hand gets tired, so i'd rather make …

Member Avatar for Tigran
0
1K
Member Avatar for SkiesBblue

Hi experts, Why does line [B]parts = new Tire*[numOfParts];[/B] generate the error [B]invalid conversion from `Tire**' to `CarPart**' [/B] in file car.cpp? The program works if I change the variable parts to be of type Tire** instead of CarPart**. I formatted my problem to a complete simple (though multifile) program, …

Member Avatar for SkiesBblue
0
1K
Member Avatar for vvinayk

Hi, I am getting errors with RTTI. In this program I have an Abstract base class with virtual function area() and two derived classes. I defined a polymorphic function and passed the derived object as argument to it which has reference to the base class as argument. I used typeid …

Member Avatar for kvprajapati
1
119
Member Avatar for megha.jain08

hii... :-/ can u plz get me out of the problem..!!!!1 m using visual studio 2005. whenever i click an update button to update values of a particular column of a gridview, all the columns gets updated with the same values. eg. if the 2nd column of 1st row with …

Member Avatar for happygeek
0
160
Member Avatar for Ali22615

I have this homework that i have to write the cxx of a header file. i started the homework but i got stuck in the meddle of it. I tried to find the abs_minimum function but it's too complicated because i have to keep track of the numbers and find …

Member Avatar for Ali22615
0
2K
Member Avatar for xfreebornx

[CODE]#include <iostream> using namespace std; struct student { int ID; char name[80]; char nationality[80]; char gender[2]; }; void insert(student array[]); void sort(student array[]); int main() { student array[100]; int answer; cout <<"Welcome to student recording system"<<endl; cout <<"Please choose one of the following option"<<endl; cout <<"1.Insert new record"<<endl; cout <<"2.Delete …

Member Avatar for xfreebornx
0
551
Member Avatar for gretty

hello I have some code that loops & takes in a number then should store it in an array. [B]My problem[/B] is that for some reason, the program only stores every 2nd number entered? [CODE=cplusplus] while (!cin.fail() && cin>>purchase) { // while a correct input is input cin >> purchase; …

Member Avatar for gretty
0
137
Member Avatar for vijay4vin

i get a debug assertion failure when i call a text file in v c ++. how to solve the error actually. it states debug assertion failure fseeki64.c line 61 stream !=null.

Member Avatar for Salem
0
95
Member Avatar for gretty

hello I have some errors in my program, which as always have to do with how to correctly syntax something :P ... I think :) [B]1st issue:[/B] I am using a 2d array as a parameter in a function but I am getting an error. I think it has to …

Member Avatar for Salem
0
143
Member Avatar for BlackPhoenix

I tried my hand at C++ client/server programs, but they were extremely difficult, even with the "best tutorial" on the Web (Beej's). I could get a basic client/server program going, but it was with "blocking sockets", and all I knew how to do was get the server to send a …

Member Avatar for VernonDozier
0
911
Member Avatar for Awebb999

I have to write code to shift all the values in the array to the right of position P, one place to the left. I can make up my own array and position P. would this code work? for (j=6; j>1;j--) { x[j-1]=x[j]; }

Member Avatar for mrnutty
0
87
Member Avatar for Hawkpath

Hello, I need help with the following code: [CODE] #include <windows.h> #include <tlhelp32.h> #include <conio.h> #include <stdlib.h> #include <iostream> bool ChangeMemVal(const char * ProcessName, LPVOID MemAddress, int NewVal, int size); int main() { printf("=== Pinball Trainer Example. Made by Hawkpath ===\n\n"); if(ChangeMemVal("pinball.exe", (void*) 0x000F4240, 1000000, 4)) printf("The score has been …

0
68
Member Avatar for BlackPhoenix

Let me explain myself, and then hopefully you can tell me a better solution. I have paid web hosting (only $2.50/mo) and in the process of learning PHP, have learned how to work with MySQL databases. I was wondering if it is possible to create a program in C++ that …

Member Avatar for BlackPhoenix
0
209
Member Avatar for tomtetlaw

THEY'RE ANNOYING! :@ This is my code: lang.h [code=c++] #pragma once #define _ASM_START namespace _TomAsm{ #define _ASM_END } #define cpp_asm _TomAsm #define _main int main(){ #define _endmain } _ASM_START template<typename _T> struct _Reg{ _T val; _Reg(_T _Val):val(_Val){} }; typedef _Reg<int> _IntReg; typedef _Reg<char> _CharReg; typedef _Reg<float> _FloatReg; typedef _Reg<double> _DoubleReg; …

Member Avatar for tomtetlaw
0
262
Member Avatar for azjherben

I'm getting inoput from a binary file, in hex. And I want it to say the first nine characters... like "0x05 0x53,0x84 " ... and so on. So how do I turn a char in hex to a string in text?

Member Avatar for mrnutty
0
299
Member Avatar for AceiferMaximus

I am getting an Illegal Indirection Error on this code, and I am not quite sure what I am doing wrong. [url]http://msdn.microsoft.com/en-us/library/aa376065(VS.85).aspx[/url] That link shows the function and what it should do. Am I on the right track? What do I have to do to fix the error. [CODE] #include …

Member Avatar for cikara21
0
321
Member Avatar for AssaultM16

Hi! I have two questions about functions. First how can I use a main() local variable in a function outside of main? And how can I use a variable in the function paramaters which already has stored information (stored in main() ), and not have to give it new information …

Member Avatar for mrnutty
0
99
Member Avatar for Tigran

Hello, I've got this project where i need to use a webcam. I'll need to get every frame made by a webcam (uncompressed) and send it to my program. My program should extract some information out of the frame and then get the next frame and do the same with …

Member Avatar for Tigran
0
161

The End.