49,761 Topics
| |
Hello everyone I have written a small c++ program where two files are compared line by line and in case the lines are different, the differing ones are put into a report.txt document.But its not working right! The first few lines which are same are not put into the report.txt, … | |
[CODE]#include<stdio.h> #include<conio.h> main() { clrscr(); double sales[10]; int index; double largestsale,smallestsale,sum,average; //initializing for(index=0;index<5;index++) sales[index]=0.0; //reading printf("Enter Value:\n"); for(index=0;index<5;index++) scanf("%d",&sales[index]); //printing for(index=0;index<5;index++) if(sales[index]<index) printf("%2d",sales[index]); //sum & average sum=0; for(index=0;index<5;index++){ sum = sum+sales[index];} average = sum/5; printf("\nThe Sum is %d",sum); printf("\nThe Average is %d",average); //largestsale int maxIndex = 0; for(index=1;index<5;index++) if(sales[maxIndex] < … | |
HELP!! can someone please help me, because i need to create a game in which i have to count how many times i've pressed enter in a matter of 1 minute. | |
cananyone tell me wats goin on in these files???? especially the 1st,3rd and 5th..... i hav tried a lot but cudnt figure out wats going on in the above mentiones files...my job is to prepare code for it.....anyone plz help! [URL="http://incognito.co.in/programs.zip"]http://incognito.co.in/programs.zip[/URL] | |
I need help with an assigment - I am to create a number systems table which consist of converting a decimal number to binary, octal, and hexadecimal. Here is my code i have so far but does not create output - any suggestions would be great - thanks #include <iostream> … | |
Hello, First, this is an extension to homework. I have all the requirements completed, but I'm attempting to write a switch that will allow me to toggle between sorting on actual data structs, or on smart pointers to data structs. By themselves, they both work, but when attempting to combine … | |
HI, I WANT TO BUILD A TREE STRUCTURE BY TOKENIZING THE WKT STRING STREAM ( BELOW ). ALSO I WANT TO ACCESS AND STORE THE VALUES OF THE CHILD NODES IN THE TREE. EX : VARIABLE PROCS_NAME : "OSGB 1936 / British National Grid" . I AM ATTACHING THE REQUIRED … | |
hello, i'm a newbie. [U]are c and c++ really similar?[/U] some people say that they are extremely similar, and taking the path of learning c first is better. i'd like to learn both c and c++. [U]which one is better to start with?[/U] and as i mentioned before, i don't … | |
In the following code snippet, T represents a class. This code is claimed to have problem due to the fact that "p" will be out of range after running "*p=a". Why? [CODE] void f1(T a) { T v[200]; T* p = &v[0]; p--; *p=a; ++p; *p=a; } [/CODE] | |
hello every one am new here and really confused with my C++ subject. i saw a few post here was deleted or not answered. i hope my one wont go without answer. now here is my problem. I REALLY DUNNO what am doing. i was able to write the program … | |
Hi all I was wondering how to pass a multidimensional array to a function: Here is my code: [CODE] #include <cstdlib> #include <iostream> using namespace std; void PrintArray (int* array, int n); int main(){ int SIZE; cout << "Enter how many records: "; cin >> SIZE; int array[SIZE][2]; for (int … | |
Hi, I have been working on a little text based interactive fiction game for a decent amount of time, but I just can't seem to figure out how I can cut up strings so that my program can understand simple commands. Is there a simple way to do this? For … | |
I am taking on a new project, this one should be a lot smaller than the previous. I want to take an exe file (a game executable), and change the memory addresses that it reads files from in memory. For instance, when you run the game executable it opens a … | |
Hi, I was thinking of writing simple Code editor pad like GEdit or Notepad++ but only for PHP and SQL. Now it is for hobby, so I want to use scintilla on wxWidgets and avoid wxWidgets component (purposely). So I was asking what are steps to write such pad. Also … | |
Hello. What i'm trying to do is simple and I know that I could just get the answer offline. However, I wanted to finish this one myself, so if someone could fix what I believe to be a small error I would appreciate it. I am simply trying to read … | |
Hi friends, I dunno how to declare global array. Its funny because, it works if declared locally. my code looks like that [CODE]private: /// <summary> /// Required designer variable. array<String^>^ salka = gcnew array<String^>(20); // GIVES ME ERROR System::String^ date; System::String^ linia; System::Int32^ token; System::Int32^ i; System::Int32^ j; System::Int32^ k; … | |
it's a very simple program: payroll calculations for 5 employees. but how to do the count? | |
Suppose your $1,000 is earning interest at 4% per year. How many years you need to double your money? Write a program to calculate the number of years! | |
Hi, I need to create a program to do a threaded merge sort (kinda), but in the meantime I am trying to pass a struct through the the Merge method (thread runs this method), but I keep getting seg faults. I am sure its something obvious, please help me out. … | |
I made a header file to convert strings to numbers of base X. That is I want: [CODE]int num=B<16,int>("FFF");[/CODE] To equal: [CODE]int num=0xFFF;[/CODE] Here is the code so far: [CODE]#include <string> int numb(char in) { if (in>='0'&&in<='9') return in-'0'; else if (in>='a'&&in<='z') return in-'a'; else if (in>='A'&&in<='Z') return in-'A'; } … | |
Hi, I have to make a Tic Tae Toe game using Classes but I have no idea how to even start. I set 3x3 2 dimentional array as private member variable. What should be public variables? Here is the instruction i was given: 1. The game board will be created … | |
Finally , ı finished my simple program. I will learn very very much thing from you And ı will ask many many questions after this time:) So I will wait your suggestions about my program [ICODE] #include <iostream> using namespace std; void encyrpt(void); // Encyrpt function prototype void decyrpt(void); // … | |
Hi gang ; The code below works fine but a more flexible one would be better. For example what am looking for an original try-throw-cath block which throws the exception "Item not found" message itself. try { SQLiteConnection ^connection = gcnew SQLiteConnection(); connection->ConnectionString = "Data Source = atbdn3.db3"; connection->Open(); System::String … | |
hello everyone, I have a problem with netbeans 6.8 (c/c++) when I compile a code because dorun.sh give me this screenshot and I could not fix this. the screenshot is the next: [url]http://img848.imageshack.us/i/dibujoyd.png/[/url] thanks for your help, | |
The exercise tells me to find the error in this code [CODE] int g() { cout << "Inside function g" << endl; int h() { cout << "Inside function h" << endl; } } [/CODE] The listed error is that function h should not be defined inside of function g. … | |
Good Morning, I'm having this error in the program " object in abstract class orderedArrayListType is not allowed. Here is the code: arrayListType.h [CODE]#ifndef H_arrayListType #define H_arrayListType class arrayListType { public: bool isEmpty() const; //Function to determine whether the list is empty //Postcondition: Returns true if the list is empty; … | |
I am making an expression tree for a school assignment and am getting these error in my code. Being quite new to C++ I have searched the web for answers to no avail.[CODE]#include<iostream> using namespace std; #include "expression.h" namespace Student { void writeNode(NodeType* node); /* Displays an arithmetic expression. @pre … | |
I found an old post (2002) on another website where someone asked how to colorize text in Linux. The reply was: [CODE]printf ("\033[31ma\033[32mb\n");[/CODE] Where the format is "\033[XXm" followed by the text to be colored. I tried this on my Ubunutu machine and it works. It even works with "cout … | |
I want to make a Application using MFC Visual Studio 2008 to make the dialog transparent besides the controls. I have uploaded the pic of a sample app (just made it for fun) [My Prog.jpg] (1st pic) Second pic is the kind of App I want (I used Photoshop to … | |
| Hi,can anyone tell me how to check if a file exists,I am using turbo c++ 3.0 Thank you for your time. |
The End.