49,761 Topics

Member Avatar for
Member Avatar for sreekiranws

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, …

Member Avatar for Agni
0
421
Member Avatar for Shodow

[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] < …

Member Avatar for jonsca
0
149
Member Avatar for cheers07

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.

Member Avatar for cheers07
0
248
Member Avatar for sahil1991

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]

Member Avatar for Ancient Dragon
0
115
Member Avatar for borich_cj

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> …

Member Avatar for caut_baia
0
311
Member Avatar for Koinutron

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 …

Member Avatar for Koinutron
0
415
Member Avatar for nikhilsamkumar

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 …

Member Avatar for nikhilsamkumar
0
112
Member Avatar for honeythigh

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 …

Member Avatar for peter_budo
0
283
Member Avatar for winecoding

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]

Member Avatar for Ancient Dragon
0
77
Member Avatar for ashrafu1

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 …

Member Avatar for ashrafu1
0
230
Member Avatar for GregPeters

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 …

Member Avatar for txwooley
0
227
Member Avatar for w1mark

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 …

Member Avatar for w1mark
0
538
Member Avatar for MasterGberry

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 …

Member Avatar for MasterGberry
0
366
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
132
Member Avatar for skips

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 …

Member Avatar for skips
0
148
Member Avatar for VasquezPL

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; …

Member Avatar for jonsca
0
1K
Member Avatar for gnyderek

it's a very simple program: payroll calculations for 5 employees. but how to do the count?

Member Avatar for Stefano Mtangoo
-1
84
Member Avatar for Sherry.K

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!

Member Avatar for VernonDozier
-4
597
Member Avatar for John Linux

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. …

Member Avatar for pseudorandom21
0
891
Member Avatar for Labdabeta

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'; } …

Member Avatar for Labdabeta
0
138
Member Avatar for narunaru

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 …

Member Avatar for narunaru
0
653
Member Avatar for margeaux54

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); // …

Member Avatar for margeaux54
0
172
Member Avatar for zehraIOI

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 …

Member Avatar for sheennave
0
128
Member Avatar for the xyz

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,

0
40
Member Avatar for Spiffy P Mcgee

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. …

Member Avatar for Ancient Dragon
0
126
Member Avatar for poloblue

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; …

Member Avatar for poloblue
0
509
Member Avatar for bailsb

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 …

Member Avatar for bailsb
0
2K
Member Avatar for txwooley

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 …

Member Avatar for txwooley
0
118
Member Avatar for Kunal Aggarwal

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 …

0
143
Member Avatar for anu07

Hi,can anyone tell me how to check if a file exists,I am using turbo c++ 3.0 Thank you for your time.

Member Avatar for anu07
0
407

The End.