51,593 Topics

Member Avatar for
Member Avatar for (Z!Z!)

I have to take two arrays, put them in a function, and then put them into a file. I have no problem actually making the arrays, but I am not quite sure how to go about defining the function for both arrays. I appreciate any help! #include "stdafx.h" #include<iostream> #include<fstream> …

Member Avatar for (Z!Z!)
0
203
Member Avatar for buixuanhai

After I enter first name then program fail. Error: RUN FAILED (exit value 1, total time: 2s). I use Netbeans #include <iostream> using namespace std; struct Student { char * firstName; char * lastName; char * telephone; }; void printStudent(Student s) { cout << "Student info: " << endl; cout …

Member Avatar for David W
0
735
Member Avatar for mary.fatulalohr

I tried fixing these errors but to no avail. Can someone please explain to me what I need to do to fix them? #include <iostream> using namespace std; int main() int arr_3d[4][3] = {{1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}}; int row, col; for (row = 0; …

Member Avatar for David W
0
163
Member Avatar for neyoibarra

i have a question is there line of code or any code that restricts the user from inputting any letter or number or any key to my choice, but in a way that when he presses any letter and i restricted the alphabet keys then nothing will happne, or if …

Member Avatar for David W
0
130
Member Avatar for neha.jebin.18

i can't fix my errors. please help me out... here's the ITEMTYPE part of my code: //itemtype.h::::: #ifndef ITEMTYPE_H_INCLUDED #define ITEMTYPE_H_INCLUDED class itemtype public: itemtype(); void print()const; void initialize(int number); private: int value; }; #endif //itemtype.cpp:::::: #include "itemtype.h" #include <iostream> using namespace std; itemtype::Itemtype() // this is the line where …

Member Avatar for David W
0
267
Member Avatar for SWEngineer

I'm using "Digital Mars" to compile the following program: [CODE] #include <iostream> using namespace std; int main() { cout <<"My name is Abder-Rahman"; return 0; } [/CODE] And, this is what I get: [CODE] C:\Users\Software Engineer\Desktop\C++\dm852c\dm\bin>dmc print1 Fatal error: unable to open input file 'iostream' --- errorlevel 1 [/CODE] Any …

Member Avatar for abelard.louvel
0
783
Member Avatar for anyumba kevin

plz community members, am a new student in programing and i would wish you people help me write a programme : that accepts marks in five subjects for a student and stores them in an array.The programme then computes the avarage and grades of the student using the scheme below. …

Member Avatar for Learner010
0
145
Member Avatar for radhakrishnan.akshai.3

how can we pass the value of an array without using index of an array i.e subscript([]).

Member Avatar for rubberman
0
130
Member Avatar for Dang_1

I just have installed VS Ultimate 2013. When I compiled a simple code, it had an error LNK1104: cannot open file 'kernel32.lib' I tried to follow instructions on internet but it didn't work. My code #include <iostream> using namespace std; void main() { int x; cin>>x; cout<<x; }

Member Avatar for Ancient Dragon
0
103
Member Avatar for ManPui

\cs2370week8\cs2370week8Assign\cardDeck.o" c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status Process terminated with status 1 (0 minutes, 7 seconds) 1 errors, 0 warnings (0 minutes, 7 seconds)

Member Avatar for mike_2000_17
0
1K
Member Avatar for john.kane.100483

Ok I really need this to fix up. And I've been awake all night just to fix the error. Can you help me with this errors. #1 Binary2Decimal() when I input a binary number it won't give an answer and it will skip the "Decimal Equivalent is: " it will …

Member Avatar for john.kane.100483
0
149
Member Avatar for BboyTurok1990

I redid the code again but this time I get an error c2061 identifier 'cout'. Someone explain to me this. I am pretty new with C++ I highly appreciate it. #include <iostream> #include <cmath> using namespace std; const double pi = 3.14159265; int main () { string name; string homework; …

Member Avatar for JasonHippy
0
271
Member Avatar for Mo90games

I have designed a programme that allows you to enter a number wich is then displayed in various forms however I am stuck with the code to convert the entered number into text can someone help? Below is what I have so far #include <stdio.h> #include <stdlib.h> #include <iostream> using …

Member Avatar for Ancient Dragon
0
145
Member Avatar for sailorsoldier

Hi guys! I have to write a code that checks to see if the password entered meets certain criteria and if it does not the whole function is supposed to start over. The criteria are that it must be atleast 12 characters and must have one upercase letter, one lowercase …

Member Avatar for Ancient Dragon
0
180
Member Avatar for nakul_pancholi

Dear all, I am learning C language. I got the following problem while running the problem. Program: [CODE]#include <stdio.h> #include <math.h> #include <stdlib.h> main() { int x; for (x = 1; x <= 250; x ++) printf("x = %d\n", x); }[/CODE] OUTOUT should be: x = 1 x = 2 …

Member Avatar for arulgee6
0
1K
Member Avatar for Sara Masri

Write a program that tests a string is accepted or rejected according to a certain Finite State Machine (FSM). The program must read the FSM before testing the input string.

Member Avatar for rubberman
0
314
Member Avatar for neyoibarra

**hey guys, well i just want to get alittle help on something, so this is my prob, i finally got the first .txt files to be made by spereating them depending on there id numbers, which in short through each new employee is another new .txt file created, but the …

Member Avatar for Ancient Dragon
0
105
Member Avatar for BboyTurok1990

I need help with this c1075 error. Everytime I build it I get this error any idea what I did wrong? I appreciate it #include <iostream> #include <cmath> using namespace std; const double pi = 3.14159265; int main () { string name; string homework; name = "Randy Calhoun, Giannis Combe, …

Member Avatar for vmanes
0
239
Member Avatar for tux4life

One of the things which attracted my attention was that there are often newbies asking how to create a password program in C/C++, often they don't succeed, well here's my response, you can use it for any purpose you want, one thing you'll have to keep in mind is that …

Member Avatar for Remy1990
0
8K
Member Avatar for john.kane.100483

OK so I'm almost done with my program. How to put this in function like putting each case like void Binary2Decimal() , void Octal2Decimal() & , void Hexa2Decimal() in "TURBO C++"? Call a function like I only want to display only the Binary to Decimal case. #include<iostream.h> #include<conio.h> #include<stdio.h> char …

Member Avatar for Schol-R-LEA
0
228
Member Avatar for evaldaskowka

Hello, is this for loop possible? Im trying to get each new value for for(a;a<sum;a++) sum variable. After countless tries i am stuck and don't think it's possible to change that... When sum = sum + laikai[i+1]; exists compiler CMD window is not responding and checking for solution... Help would …

Member Avatar for evaldaskowka
0
415
Member Avatar for john.kane.100483

Hi I need help to correct this program :( NOTE THIS IS "TURBO C++" #include<iostream.h> #include<conio.h> #include<stdio.h> char value; char t, u, v; char answer; void Binary2Decimal() { gotoxy(1,17);printf("[BINARY TO DECIMAL CONVERSION]"); char b2,f2=1,d2=0; gotoxy(1,19);printf("Enter a Binary number: "); scanf("%d", &b2); printf("\n\n"); while(b2>0) { if((b2%10)==1) { d2=d2+f2; } b2=b2/10; f2=f2*2; …

Member Avatar for David W
0
203
Member Avatar for shahirulnizam
Member Avatar for David W

In the last few days, I have noticed a very old thread ... resurrected ... about a non-standard C getline function. To all who may like a C readLine function ... a C function that reads in a dynamic C string of any length ... a function with a similar …

0
214
Member Avatar for Fadhli_1

can this thing below work????? {#include<iostream.h> #include<conio.h> #include<stdio.h> char value; char t, u, v; char answer; void Binary2Decimal() { switch(t){ case 'a': //ok cout<<endl<<"[BINARY TO DECIMAL CONVERSION]"<<endl; cout<<endl; long b2,f2=1,d2=0; cout<<"Enter a Binary number: "; cin>>b2; cout<<"\n\n"; while(b2>0) { if((b2%10)==1) { d2=d2+f2; } b2=b2/10; f2=f2*2; } cout<<"Decimal equivalent is: "<<d2<<endl; …

Member Avatar for brett.warren.1612
0
135
Member Avatar for 21310051
Member Avatar for neyoibarra

SO MY PROB HERE IS JUST PLAINLY THE BACKSAPCE FEATURE OF MY PROGRAM EVERYTHING WORKS FINE EXCEPT FOR THE FACT THAT THE PROGRQAM IS CONSIDERING THE BACKSPACE KEHY AS PART OF THE CHARACTERS. int verification2() { system("cls"); char userChar[100], choice = 'Y', input, passChar[100]; for (int i = 0; i …

Member Avatar for nullptr
0
172
Member Avatar for Rashmi_1

Hi, I need some help with sorting my string comparison. Bascially what I have to do is this: To have numbers sorted properly even when they aren't justified with leading 0's: 1 2 ... 9 10 Instead of: 1 10 2 ... 9 Also to have numbers sorted properly even …

Member Avatar for Rashmi_1
0
907
Member Avatar for kimanthi

Hello everyone Am actually a newbie and learning C++ on my own. Have been trying to generate a code that prompts a student to enter his/details and after finishing. it couts his/her information. And prompts another student data to be entered. i have already some simple code here but it’s …

Member Avatar for kimanthi
0
251
Member Avatar for ReneeJA

Write a program that accepts the name and ID number of 5 students and stores them in an array. After all the students have been entered, the application should display the title “Student Roster” and then list the names in the array. 2D Array. #include <cstdlib> #include <iostream> #include <string> …

Member Avatar for ReneeJA
0
240
Member Avatar for Wayne_2

I have a final project for C++ class that requires us to demonstrat each thing that we've learned, a list of 24 things that range from using binary numbers, to loops to passing arrays and polymorphism and recursion. What I would really like to try is to make a simple …

Member Avatar for mike_2000_17
0
212
Member Avatar for john.kane.100483

Ok so I manage to built the program I want but there are problems. #1 The conversion from octal to decimal is not correct. #2 The conversion from hexadecimal to decimal some answers are correct. #3 I don't know how to character array this program. So what I am asking …

Member Avatar for Schol-R-LEA
0
251
Member Avatar for Wesam_2

Hi, I need some help . Bascially what I have to do is this: what doing cin.get in the prpgram just do space or give value.

0
130
Member Avatar for glamiex

This is the program that I made // Chapter 5, Programming Challenge 8: Math Tutor #include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> using namespace std; int main() { int num1, // The first random number num2, // The second random number choice, // The user's choice of problem studentAnswer, …

Member Avatar for Schol-R-LEA
0
791
Member Avatar for Andrei_2

Sample Run ( OUTPUT ) Enter a word: computer The well-ordered words of length 3 that can be formed from the letters in the word "computer" are: cem ceo cep cer cet ceu cmo cmp cmr cmt cmu cop cor cot cou cpr cpt cpu crt cru ctu emo emp …

Member Avatar for samson.dadson.3
-1
148
Member Avatar for shelan619

• The program consists of a Class customer and the Main function. • The class customer contains private data items as item value, interest payment, tax payment and total payment. • The class customer includes two public functions as lease Cal() and lease Show(). • lease Cal() function receives item …

Member Avatar for samson.dadson.3
0
201
Member Avatar for Pyler

How's the result to this 7? void foo(int i){ if(i>1){foo(i/2);foo(i/2);}cout<<"#"<<endl;}

Member Avatar for vmanes
-1
222
Member Avatar for ashley.vanhoesen.7

I need to widdle down a queue of people until one person remains in the queue, that person is the chosen person for a task. The mothod I am writing take the queue of people and a number, which represents a number drawn from a hat. Then the queue is …

Member Avatar for NathanOliver
0
287
Member Avatar for d100man

the "f" for female is not being recognized so it is not outputting what it should and also the count statement is giving out an incorrect format could someone give me some pointers as to what im doing wrong #include<iostream> #include<string> using namespace std; int main(){ int femalecount=0,malecount=0,total; string race,office,sex; …

Member Avatar for Schol-R-LEA
0
111
Member Avatar for MiniApocalypse

Hey guys! Im having problems with a snippit of code ive written. I know this is basic C++ so its a little embarasing that i cant work it out myself. Ive googled the run time error message but im not 100% sure i understand what it means. Unhandeled exeption, access …

Member Avatar for Ancient Dragon
0
349
Member Avatar for Rallici

Dev-cpp 4.9.9.2 Windows 7 Hello I have been using my current version for quit a while and I restarted my computer today and now no matter what I try to compile I always get the return of: [CODE] Compiler: Default compiler Executing g++.exe... g++.exe "C:\Users\Salica\Documents\Cpp\hello.cpp" -o "C:\Users\Salica\Documents\Cpp\hello.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" …

Member Avatar for learner_new
0
2K
Member Avatar for CHETNA_1

is there someone who can explain me this question? i googled about cardinality and i got to know that it means the no of elements in set. question: Take an integer n < 1024 as input from user. Write a function to compute the value of the following function. f(n) …

Member Avatar for rubberman
0
69
Member Avatar for taverasme

Hi all, First time poster here, I've referenced posts here on daniweb in the past and it has always been helpful, thanks! But I can't find the answer to this particular problem here on the forums. I need to write a basic string parser as part of a coding assignment …

Member Avatar for Nikolas9896
0
6K
Member Avatar for Ese

I've tried doing it but it doesnt run The array of real numbers is set. a) To delete from the array positive elements. b) To calculate the sum of negative elements in the array. c) To calculate minimum of positive elements in the array. solve using functions

Member Avatar for StuXYZ
0
145
Member Avatar for mell.mattingly

Hey guys! I have a class program here that I am stuck on. This is my first time officially asking for help, but after studying all avenues and research I still find myself wracking my brain. Most of the code is complete and without error...except for the last bit...of course. …

Member Avatar for Iworlock
0
854
Member Avatar for rron17

#include <windows.h> void gotoxy(int x,int y); int main() { int i; int y=6; int x=9; for(i=1;i!=0;i++) { system("color 1"); sleep(500); gotoxy(x,y); printf("%d",i); } getch(); } void gotoxy(int x,int y) { COORD coord = {x,y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord); } How to change the color when the number changes ? And the color must …

0
101
Member Avatar for john.kane.100483

Can anyone edit this program from "Base 10 to any base" --->>> to "From any base to base 10 with character array" .I would really appreciate this a lot. I use turbo c++ compiler. #include <iostream.h> #include <conio.h> #include <stdio.h> void main(){ char value; char t, u, v; char answer; …

Member Avatar for David W
0
225
Member Avatar for shweta_1

what are the difference between the access specifiers and private and protected ?

Member Avatar for David W
0
77
Member Avatar for shweta_1
Member Avatar for shweta_1
Member Avatar for David W
0
67

The End.