51,592 Topics

Member Avatar for
Member Avatar for Latha cv

write a program whichask the user to enter the positive integer. then the program to display whether the user to enter the number is prime number or not. (prime number is the number which is divisible by one and the number itself)

Member Avatar for Deme
-6
83
Member Avatar for happymadman

How would I fill a two-dimensional array up with numbers. map_height = 9 map_width = 8 I have this code: [code] for (i=0; i<map_height; i++) { for (p=0; p<map_width; p++) { room_numbers[i][p] = w; w++; } } [/code] But when I try to print it out it comes up with …

Member Avatar for happymadman
0
119
Member Avatar for axed

I am not sure if the title of my thread indicates where the problem is, but that is what I think it is. [code] void convertFormat(vector<string>& files, map<string,int>& tickerMap, vector<int>& numRecords ) { string txt = ".txt"; string filePathNameString; for ( int k =0 ; k < (int)files.size(); k++) { …

Member Avatar for thelamb
0
130
Member Avatar for cyborg22

:) Hello experts, Im taking a C++ class and i was asked to Write a program that uses a structure named MovieData to store the following information about a movie: Title Director Year Released Running Time (in minutes) I've come down to making it compile, but, when it couts the …

Member Avatar for programmersbook
0
386
Member Avatar for carey_amanda

Im doing a school project. have to do dllimport as the SiUtil.dll is written in C++. But im not sure the coding below is correct as there is error. Please advise needed. [url]http://www.silabs.com/Support%20Documents/TechnicalDocs/an117.pdf[/url] Thanks a million. [CODE]using System; using System.Collections.Generic; using System.Windows.Forms; using System.Runtime.InteropServices; namespace ProgrammingInterface { static class Program …

0
71
Member Avatar for blur_guava

i everybody, I am required to find out if the following is a standard practice to create a subclass. Take for instance, I have to create a class library (ClLib) with 2 classes using Visual Studio: Class1.cs &amp; Class2.cs. Next, I open up the .CSPROJ file of ClLib and modify …

Member Avatar for blur_guava
0
237
Member Avatar for nunchuckie

Hi, I'm having problem with my linked list. The program I'm making should read in positive and negative numbers and put them into two separate lists. The numbers should be in rising order in the list. example: input: 3 5 1 -6 -2 -1 printing out the lists: pos: 1 …

Member Avatar for mrnutty
0
149
Member Avatar for samsons17

i'm so sory because i made mistake when asking about this before.. so here i'll make correction in this post.... actually what i want to ask is why my cin.fail() code do not works?? i want this program to ask the user back the same question if the user enter …

Member Avatar for VernonDozier
0
182
Member Avatar for theABCasian

hello all working on a class project in C++ using eclipse and g++ stuck a zip of the project as an attachment but here is the basics [CODE]#include <iostream> #include "Complex.h" #include "FileHandling.h" using namespace std; int main(int argc, char **argv) { FileHandling file();// opens the file and gets the …

Member Avatar for theABCasian
0
352
Member Avatar for jojomakinen

Hello to all code gurus! First of, I wouldn't lie, i am not a professional programmer.....I am more of the opposite. I was given a program to write during a 4 day C++ programmers boot camp that I signed up for (which ended friday actually). By profession am a graphic …

Member Avatar for jonsca
0
152
Member Avatar for confusedndazed

Hello all, I need to create a function call to calculate the average...Can anyone help with that?? I'm not sure how to create a function in my code to calculate the average. My code currently terminates after I enter the 50 inputs and does not compute and read the average. …

Member Avatar for jonsca
0
89
Member Avatar for asweetroxxi

i have writen the program but i cant seem to print result. the program builds a stack of numbers, then it adds,subs,mult, or divides all the numbers. for example 4 numbers are put in 1,2,3,4 it will ask what you wanna do . the answer should be 10 but instead …

Member Avatar for Lerner
0
133
Member Avatar for sirdanman10

I don't know if anybody here programs in C++ for the AS/400, specifically the Personal Communicator (PCOMM)... I have been able to successfully write programs in Visual Basic for Applications with Excel but I am having a hard time with C++. When I try to compile one of the sample …

Member Avatar for sirdanman10
0
167
Member Avatar for Lilal

Hey, I'm trying to do some compression on an ascii saved file, and running into problems. The original file starts off as such: [CODE]7+'Y 2+'J0-B)#0 [/CODE] I can read this in, and I get it as: [CODE]6 1 55 32 32 41 85 80 120 5 2 33 85 81 …

Member Avatar for Lilal
0
299
Member Avatar for kamikazekazuo

[code] #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; //------------------------prototypes---------------------------------- void ReadData(int &x, int &y, int &z); float FindMaxMin(int x, int y, int z, float &max, float &min); float ComputeAve(float x, float y, float z); void ShowAll(float x, float y, float z, float average, float max, float min); //-------------------------------------------------------------------- …

Member Avatar for jonsca
0
156
Member Avatar for aloooh

Please help, I can not answer on the project please help me Project Facility

Member Avatar for aloooh
-6
51
Member Avatar for Neon87

I have a quick question. I use getline to read from a file and put the line in a string s I call cout<<s and the output is this: "HELLO, PLEASE \n "ENTER" A NUMBER \n" why are the \n ignored and treated as strings? thanks

Member Avatar for Neon87
0
132
Member Avatar for HITMANOF44th

i am having trouble with testing to see if aData is equal to exit i have tried a few diffrent things the only thing i have relized is that the compiler say that aData is a multi character constant any help is greatly appreciated [CODE]while (exit != 1) { char …

Member Avatar for HITMANOF44th
0
126
Member Avatar for kevinkev

using functions write a program that captures details of a customer at a bank, account number, opening balance.The program should also include a function that allows a client to deposit money to account , withdraw money,calculate balance & query balance.

Member Avatar for pac-man
-3
80
Member Avatar for ziyakhan10

I am trying to write a program to find nearest prime to a number to its left...using for loop i just don't seem to get it right [CODE] #include<iostream.h> #include<conio.h> void main() { clrscr(); int n1,flag=0; cout<<"Enter The Number"<<endl; cin>>n1; for(int i=n1;i>0;i--) { for(int j=2;j<(i/2);j++) { if(i%j==0) { flag=0; } …

Member Avatar for Skeen
0
4K
Member Avatar for laconstantine

I started with debuging so I now debug all programs I can to understand the full work off microprocessor. I know basic ASM level so no problem here. look what i wana ask [CODE] --- c:\users\zippo\documents\visual studio 2008\projects\debug\debug\main.cpp -- #include <iostream> using namespace std; int main() { 00031370 push ebp …

Member Avatar for Ancient Dragon
0
205
Member Avatar for Eternity[LK]

Hello. I have created a simple program which generates 3 random numbers, puts them in a text file, reads them, and then does 3 small calculations, results are put in another text file. Program is working correctly on my PC, however there is a catch. I need to submit it …

Member Avatar for jonsca
0
369
Member Avatar for progag

write a program that will multiply two dimentional arrays as follow: 1. The program should prompt the user for the dimention of the first array (row x coloum). 2. The program should get the values of the first array one by one. (e.g. program should display "enter value of a[1][1]= …

Member Avatar for Dave Sinkula
0
96
Member Avatar for ahvicm

#include<stdio.h> #include<conio.h> main() { window(10,55,22,77); textbackground(RED); clrscr(); } is this correct?? i run it but it didn't display anything. my prof. have an example bout this he said that the #'s inside the parentheses are the sizes of the box, (x1,y1,x2,y2) x1 is the top line of the box, y1 …

Member Avatar for mahi oberoy
0
123
Member Avatar for confusedndazed

Hello all, I'm getting an error telling me "'}' is expected at the end of input" but '}' is there. Any help with these issues? Here's what I have so far: [CODE]#include <iostream> using namespace std ; void displayTitle () { cout << "Active Duty Navy Personnel Program" << endl …

Member Avatar for jonsca
0
123
Member Avatar for new programer

Hello all, I have been trying to use swtich cases in conditions but it won't work what I mean is like this; [COLOR="Red"]do{ cout<<"Enter a valid number"; cin>>number; switch(number) { case 0: bla bla break; case 1: bla bla break; case default: cout<<"re-enter"; } }while(defalut);[/COLOR] if that can never happen …

Member Avatar for new programer
0
82
Member Avatar for bobsta

Hi, I am writing a simple graphics engine using homegeneous coordinates (fourVector) and the corresponding 4matrices (fourMatrix). fourVector.cpp: [CODE]fourVector::fourVector(float x, float y, float z, float w): x(x),y(y),z(z),w(w){ };[/CODE] fourMatrix.h [CODE] class fourMatrix{ public: fourVector i,j,k,l; ... }[/CODE] fourMatrix.cpp: [CODE]fourMatrix::fourMatrix():i(fourVector(1,0,0,0)),j(fourVector(0,1,0,0)),k(fourVector(0,0,1,0)),l(fourVector(0,0,0,1)){} fourMatrix::fourMatrix(fourVector &i, fourVector &j, fourVector &k, fourVector &l): i(i),j(j),k(k),l(l){ } ... …

Member Avatar for MrSpigot
0
101
Member Avatar for transfernly

hi....i am writing a code which reads the contents of file....it has first name, lastname and phone number.....now i want ot read all the first names into one array second into another and phone numbers into third array....i tried but i could read only line by line.....please help out...my code …

Member Avatar for GrubSchumi
0
101
Member Avatar for lovely soso

Write a C++ program that asks the user to enter the length, width, and depth of a swimming pool using getValues( ). calculate the cubic volume using calcCubic( ). Print the result using printCubic( ).

Member Avatar for Divyab
0
91
Member Avatar for Xaenthe

I just know I'm doing something stupid. The part of my assignment I'm working on is to prompt the user to enter the name of a stock, earnings per share, and price to earning ratio, and then display it after everything is entered. What it's doing now is asking for …

Member Avatar for Mouche
0
107
Member Avatar for fahad moosa

sir iam a begineer student and i want to study about c.in turbo c compilers with starting.plz tech me about the function return and pass though function.

Member Avatar for Mouche
-1
95
Member Avatar for joperalez

I know this is using C. But if i was using the stdlib.h to use C in C++, can i somehow save the output into a variable. That way i can save the value for later use. something like... int a = 15; int b = 7; int hexValue = …

Member Avatar for Nick Evan
0
124
Member Avatar for jephthah

I don't understand. Nobody in the US uses this crappy compiler with it's non-standard libraries. No one in the Western World seems to use this. even in second world countries in central and south america, they don't use this. so how is it that Borland seems to have a complete …

Member Avatar for jephthah
2
139
Member Avatar for pri_skit

hii, I am getting "Error Creating bitmap!" in EVC++ 4.0 on Window CE 5.0. I don't where this error came from. I am using CreateCompatibleBitmap and BitBlt for drawing the screen. I have checked all Error codes , but no luck. Description of Error : It’s the SNAP window with …

Member Avatar for Clinton Portis
0
69
Member Avatar for daviddoria

Why people write such cryptic code I will never understand... Can someone explain what is going on in the following: [code] double color = {1,2,3}; double *ptr; // ... assign ptr .... *ptr = *color++; ptr++; [/code] So this line [icode] *ptr = *color++; [/icode] sets the value of the …

Member Avatar for kvprajapati
0
131
Member Avatar for travism

I wrote the following function that takes a string with spaces and replaces the space with an underscore ( _ ). The function works, but I believe there is a less novice way of doing it. Anyone have any suggestions? BTW, this is written in Linux and compiled with G++. …

Member Avatar for travism
0
7K
Member Avatar for dalymiddleboro

Hello guys, I'm brushing back up on C++ it's been a long semester of Assembly Language. Anywho, I am writing a program that keeps track of my grades and can average them up if I need and do many other things. I'm using a switch statement as my menu select. …

Member Avatar for mrnutty
0
116
Member Avatar for lotrsimp12345

Here's what i have. Not sure what it is doing exactly. You pack a account object and then you write it to the buffer right? So shouldn't it print after i write it? Main #include <iostream> #include <iomanip> #include "account.h" #include "Lentext.h" #include "Deltext.h" using namespace std; int main() { …

Member Avatar for Ancient Dragon
0
323
Member Avatar for EngneerNitemare

Hey all, I have this for loop and it keeps printing a '}' at the end of my alphabet and I can't figure out why. Please help me figure out how to get rid of it! :) Thanks! - EngneerNitemare [CODE]// PREPROCESSOR DIRECTIVES #include <iostream> using namespace std ; // …

Member Avatar for mrnutty
0
139
Member Avatar for aitrade

Hi, I have a similar problem. I need to read and store information from a file such as: in int count=7; //count int float end = 7.5 ; //end out float myout =0; //my out I need to store type(e.g. in or out), variable type (e.g. int), variable name (e.g. …

Member Avatar for aitrade
0
75
Member Avatar for sheztc

Hi i'm new to C++ and have made a grading system application. The application works, but I would prefer to use one variable for student name instead of two seperate variables, but when I try to do this it skips to the next line of code when I run the …

Member Avatar for jonsca
0
132
Member Avatar for etsayhaile

amenu driven program using link list data structure,which keeps track of student record of auniversity. the system should maintain at least the following information about student. name year id number DEPARTEMENT age CGPA

Member Avatar for Ancient Dragon
-1
508
Member Avatar for spookyfish

Hopefully this title makes some sense, i wasn't really sure what to put. Hi i need some help with this assignment. Unfortunately, I'm not sure what I've done is anywhere close to what it needs to be. I need to read a list of customer data from a text file …

Member Avatar for Ancient Dragon
0
124
Member Avatar for thanjaa

Hi We have dd command in Unix to make an image of the entire hard disk or a partition of it (bit copy not just a file copy). I would like to know how to do the same in C++. Thanks in advance....

Member Avatar for Ancient Dragon
0
206
Member Avatar for Snapster5

heya, i am working on this program wonderig anyone can help me finish it . i put in most of the //info on whats suppose to happen but am having trouble figuring out actually how to. [CODE] *Program Description: This program is designed to insert numbers into * an array …

Member Avatar for Ancient Dragon
0
179
Member Avatar for BobRoss

Trying to replace '\n' or its decimal equivalent of 10 after it has a decimal value added with its original value of '\n' or 10. This way the newline character won't appear in the ciphertext as some other visible character. [code=c] while (!plainText.eof()){ string plainLine = ""; getline(plainText, plainLine); int …

Member Avatar for BobRoss
0
122
Member Avatar for ukbassman88

This is the last questions I have about arrays. I have no idea of where to go with any of them except writing the header of the functions with the parameters. Again this is just questions from a study guide for my final exam so I am not asking you …

Member Avatar for Lerner
0
132
Member Avatar for ukbassman88

This is another question from my study guide for my final exam. If you all could please give me some help. Write a value returning function called "found" with parameters of a float array a float item and a integer length, that searches the array for any value greater than …

Member Avatar for ukbassman88
0
95
Member Avatar for TylerTCF

Hey Everyone, I have developed a program to help me geocode approximately 100,000 addresses from Google. After doing some i/o to bring all the names into a vector in C++, I have now 100,000 distinct addresses that I must pull up, retrieve the code from google's server via csv output, …

Member Avatar for TylerTCF
0
138
Member Avatar for rena0514

hey i am trying to write a program that allows two users to play tic tac toe....right now i am doing the program in pieces i have accomplished setting up the two dimensional array. i am having a problem changing the * thats in a section of array to an …

Member Avatar for rena0514
0
155

The End.