49,761 Topics

Member Avatar for
Member Avatar for soka2oo7

i'm trying to make a snake game & i can't make the lenght of the snake increase & it's score & the fruit appears one time only & i have to press on the arrow all the time please help me in this code today please.[CODE]#include<graphics.h> #include<conio.h> #include<math.h> #include<time.h> #include<stdlib.h> …

0
57
Member Avatar for andy_aphale

hey programmers, i need some help. i want to devlop a program which accept any three number or alphabets or symbols from user and show output as all the possible combinetion of the entered number or alphabet or symbols. pls guys give me complete program code its urgent.

Member Avatar for Salem
0
142
Member Avatar for bhuwanrc

[code=cplusplus] void fishing(vector<Fish*> &basket); int printBasket(vector<Fish*> &basket); int main() { vector<Fish*> FishVec; Fish* aFish; int totalweight=0; int i=0; while (totalweight<15000) { fishing(FishVec); aFish=FishVec.at(i); aFish->printMe(); if (aFish->acceptable()) { totalweight+=aFish->getWeight(); cout<<"total weight:"<<totalweight<<endl; cout<<" Has been put in the basket"<<endl; } else { cout<<" Was released"<<endl; } i++; cout<<endl; } } void fishing(vector<Fish*> …

Member Avatar for Salem
0
77
Member Avatar for mbarriault

I have a class (for the mathematically inclined, it's a tensor class that allows me to work with tensors of any rank and dimension), and I'm trying to set up assignment in a particular way, but having trouble. The idea comes from the vector class. With that, you can retrieve …

Member Avatar for mbarriault
0
80
Member Avatar for shotjase

i am trying to implement a database of books and i am have to use linked lists and possibly dynamic arrays for the first time so i am a bit confused..i just wanted to know if this is how i should b going about my constructors and if theres anything …

Member Avatar for Cybulski
0
112
Member Avatar for Thew

Hello, I'm trying to use some default (static) members for my class. At first I've created class which looks like this (this is just a small code): [CODE] //rozšírenie materiálu, M (par (ext)) typedef struct ExtendedMaterial { //hmotnosť float Substantiality; //krehkosť - tuhé látky, viskozita - tekuté látky float Insubstantiality; …

Member Avatar for Thew
0
92
Member Avatar for Cosa

Hi, I am having a problem with returning a 2d array back to the main in my program. The program reads in a matrix from a file, then it has to multiply etc, however i cannot get the print function to work since the array that is made in the …

Member Avatar for Nick Evan
0
145
Member Avatar for Race

hi i ave an assignment on point of sale terminal where i have to write a program so that it displays the product ID, amount of product , cost of each product and then the total cost. the following code shows how i've started it. Could some one tell me …

Member Avatar for Nick Evan
0
75
Member Avatar for sagz

Hi all, I have a program that reads a text file and counts the frequency of phrases, for phrases up to ten words long. I solved a problem with printing out phrases that occur more than once, however I have discovered that my program reads punctuation marks and includes them …

Member Avatar for sagz
0
172
Member Avatar for dougy83
Member Avatar for GPXtC02

New to classes. Getting alot of errors when calling the private member variables (from down in main). Most are telling me either i can't access the private member variable IDs or the other member variables i'm attempting to access (debit, credit, balance) are undefined ('identifier not found'). Also getting 'overloaded …

Member Avatar for GPXtC02
0
127
Member Avatar for CoolGamer48

Hey, so I have a file I use to store my own math functions called MyMath.h. I included MyMath.h in my main.cpp file and it worked fine. But then I tried including it to another file, and I get this error: Block.obj : error LNK2005: "int __cdecl Random(int,int,bool)" (?Random@@YAHHH_N@Z) already …

Member Avatar for CoolGamer48
0
170
Member Avatar for c++noobie

I have been teaching myself c++ for a little while now and came across something I couldn't figure out. I am trying to figure out how many char*s there are in a char**. In the current program I am using *argv[], so I can access it through argc, but is …

Member Avatar for Ancient Dragon
0
85
Member Avatar for Aamit

I want to run Exe after 1 minute when computer starts Means suppose comp starts at 10:00:00 pm my exe automatically executes at 10:01:00pm How to do it through program??

Member Avatar for Duoas
0
95
Member Avatar for Nemoticchigga

I am having an issue with the following code: [CODE]SerialPort^ com = gcnew SerialPort("COM1", 9600); array<unsigned char>^ messageBuf = gcnew array<unsigned char>(512); com->Open(); com->Read(messageBuf, 0, 512); com->Close(); [/CODE] messageBuf is not being filled with anything. I know the port is open cause writing works fine. Any ideas why this is?

Member Avatar for tesuji
0
98
Member Avatar for JohnnyC26

I am creating a book database using C++. I am using a book structure which contains all the information for each book that I create. The problem I am having is that I want to be able to search the file I am printing the books to for a specific …

Member Avatar for tesuji
0
96
Member Avatar for tiney83

I'm stuck on figuring out the best to do this assignment. I need to it with either a single array or a 2d array, no structs or classes or anything. Should i just have a 20x8 array and enter the data that way? A company has records for the hours …

Member Avatar for Ancient Dragon
0
98
Member Avatar for En1ro

[CODE=c++]int j=1; fstream kd("Gydytojai.sed"); while (!kd.eof()) // Checking if the entry already exist; { if (gydmas[j].vardas==pgyd.vardas) {ShowMessage(L"Gydytojo id jau egzistuoja"); pagalb=true;}; // if the entry exist, variable pagalb becomes true j++;}; kd.close(); [/CODE] Well, i'm checking if in the file Gydytojai.sed while it is not end of line checking if …

Member Avatar for En1ro
0
104
Member Avatar for marcelomdsc

Hi, this is my first time posting to this forum so please let me know if I'm doing anything wrong. I would like to know how to do the following... a. Write the internal representation of “17” in ASCII using two binary numbers b. Write 17 and -17 in two’s …

Member Avatar for marcelomdsc
0
98
Member Avatar for latour1972

Write two program segments (functions) that accomplish each of the following: a) A function that Calculates the integer part of the quotient when integer a is divided by integer b. b) A function that Calculates the integer remainder when integer a is divided by integer b. Use the functions developed …

Member Avatar for latour1972
0
104
Member Avatar for Blondeamon

Hello guys under a project i have to complete for this semester i have to think and implement a shortest path algorithm other than the ones i have already coded so far for this course , which are: - Bellman Ford - Floyd - Kruskal The whole project is a …

Member Avatar for Blondeamon
0
118
Member Avatar for architact

Please help me in doing this problem in C++ without filing ______________________________________________________________________ [code=cplusplus] #include<iostream.h> #include<conio.h> #include<stdio.h> #define min(a,b)((a)<(b)?(a):(b)) int a[6000]; main() { file*input=fopen("number.in","r"); int n,p2,p3,p5,p7; a[1]=n=p2=p3=p5=p7=1; while (a[n]<2000000000) { a[1+n]=min4(2*a[p2],3*a[p3],5*a[p5],7*a[p7]); if (a[n]==2*a[p2]) p++; if (a[n]==3*a[p3]) p++; if (a[n]==5*a[p5]) p++; if (a[n]==7*a[p7]) p++; } { fscanf(input,"%d",&n); if (n==0) break; printf("the%d",n); if …

Member Avatar for DigitalPackrat
0
155
Member Avatar for joshmo

am trying to figure out how to insert a new number in a linked list after a specified number...i am failing to figure out how to fix in the number in the list...here is the partial code..any help is appreciated [code=cpp] void insert(detailsPtr& head) { detailsPtr prev, current,tmp; int num,curr_num; …

Member Avatar for joshmo
0
79
Member Avatar for shinpad

Hi there, I am very new to C++ so please bear with my what is clearly terrible work I am trying to figure out what should be (I think) a simple program that will check a couple of pieces of information and tailor an output based on the input, if …

Member Avatar for Nick Evan
0
122
Member Avatar for Aamit

I am creating client-server application. client sends text file through `sendto()` function to server. Problems are following-- 1>At the server i am writing into new abc.txt file. but problem is it writes some garbage data also.... server side function ---- char RecvBuf[22610]; int BufLen = 22610; recvfrom(RecvSocket,RecvBuf,BufLen, 0,(SOCKADDR *)&SenderAddr, &SenderAddrSize); …

Member Avatar for Prabakar
0
616
Member Avatar for shadowfire36

ok after somet time im now ready into breaking my code apart into 4 class Sports,NBA,NFL,MLB, here is the original code [code] #include <iostream> #include <fstream> #include <string> using namespace std; // definition of strct that will hold all information of match struct Match { string Season; string Team1; string …

Member Avatar for shadowfire36
0
85
Member Avatar for ryanlcs

Hi There I used to develop C programming some 5 years back using Visual Studio. Now I am on my way to develop C++ using Visual Studio .Net 2003. I started of to create new project, there are numbers of different type to choose (Win32 Console Project, Console Application (.Net), …

Member Avatar for ryanlcs
0
152
Member Avatar for sagz

Hi all, I am a newbie to programming and have almost complete my assignment 'Frequency of words and phrases' to a satisfactory standard. My program reads a text file and counts the number of phrases within the file (A phrase is defined as a sequence of one or more words), …

Member Avatar for sagz
0
154
Member Avatar for savinki

This is the code segment I hv written. But its compiling well. but it doest give expected output, for me.. I want to write a function to split a char array by taking "," as the delimeter. I m not splitting the array at once. I m doing it one …

Member Avatar for Agni
0
100
Member Avatar for Dannyo329

Hey Everyone. Is there any way to make a sub? For example there's int main(), can I make something else like int menu() and sort of link int main to int menu? I have no idea how to do this.:-/

Member Avatar for Laiq Ahmed
0
155

The End.