51,593 Topics

Member Avatar for
Member Avatar for pinaka

#include<iostream> #include<string> int strlength(&a); using namespace std; int main() { string s1,s2; cout<<"Enter the strings u want to check length::"; cin>>s1>>s2; strlength(s1); strlength(s2); return 0; } int strlength(&a) { for(int i=0;str[i]!='\0';i++) { int count++; } cout<<"The length of string is::"<<count; }

Member Avatar for pinaka
0
182
Member Avatar for candicecandy

I am a beginner in C++ programming and I badly need help. I just need some tips for programming a tic tac toe game that asks the user how many times they want to play, and should track how many times they win. Also, this program should not use arrays. …

Member Avatar for Schol-R-LEA
0
224
Member Avatar for a9602

hey im new to c++.ive done basic programs but got to do a project with graphics in it,..........ive no idea what graphics is......so pls suggest some basic stuff like how to enter some txt in a box and how to change background colour of a page.......... with sincere regards

Member Avatar for a9602
0
88
Member Avatar for john540
Member Avatar for STVG

Hi! i'm new in c++, i have some problems with files... -first of all i want to know that how i can save a file with the name that program gives it? for example i run the program and type"file1" then save the file with name "file1.txt". whatever i give …

Member Avatar for Ancient Dragon
0
163
Member Avatar for andrew mendonca

Define a getTopTwoScores() function with the specification and prototype shown below: // Set highest to the score with highest value and secondHighest to the score with the next highest value. // If there are two highest scores with the same value then set both highest and secondHighest to that value. …

Member Avatar for nullptr
0
200
Member Avatar for jonny93

What is the best way to practice C++ coding on Windows 7, and at the very least free? I want to get better at programming, but I don't have a compiler.

Member Avatar for mike_2000_17
0
904
Member Avatar for izabella.pearson

When I complie and run my program it works but no matter what day you say January first is it sets it as monday. Any ideas on how to fix this? #include <iostream> #include <fstream> #include <iomanip> #include <fstream> using namespace std; int year, month, FDOM, mDays; int getYear(); int …

0
66
Member Avatar for Some Dude

Alright. I am making some decent progress here. I am trying to add a toolbar to my basic text editor that I am making using an internet tutorial. Anyways the problem is that I can get the bitmaps to display but they appear to be just that... bitmaps. When I …

Member Avatar for Some Dude
0
476
Member Avatar for rajkumar.it

Hello guys, I am working as a C C++ UNIX software programmer , and looking for freelancer projects. could you please let me know how can i get the project?

Member Avatar for rajkumar.it
0
114
Member Avatar for vishalonne

Hi all members I'm a learning how to use C/C++ on Netbeans IDE. I got an [tutorial on net](http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html#intro) I am trying this tutorial to complete since last 5 days--- I followed the tutorial step by step. My system settings - Window 7 32 bits Netbeans 7.1 JDK 1.7 cygwin …

Member Avatar for vishalonne
0
651
Member Avatar for magdy.elbaset

hello guys, i want to write a program to cout the numbers i input (a-z) to (z-a) like input (1,2,3,4,5,6,7,8,9,10) output(10,9,8,7,6,5,4,3,2,1) and i tried this but it's out put the same sorting #include <iostream.h> void main(void) { int Number[11],i,j; cout<<"Enter The Numbers"<<endl; for (i = 1; i<=10; i++) { cout<<"Number"<<i<<": …

Member Avatar for magdy.elbaset
0
110
Member Avatar for Musa_Jutt

Guys I installed "windows Vituual PC" with xp vesion in windows 7 ultimate 64 bit. Now I am not able to install c++ software in it so please tell me how to install turbo c++ in VMplayer plzzzzzzzz full detail .

Member Avatar for Ancient Dragon
0
46
Member Avatar for whileiforelse

Well this is my assignment for uni. I've done all the main and difficult bits- and now I cannot believe that I'm stuck at the simplest task. Im told to make a menu that gives user three options to choose from. Choosing option 1 will ask to choose from 3 …

Member Avatar for whileiforelse
0
194
Member Avatar for firras

If someone could help point me in the right direction, it would be much appreciated. My problem is merge sorting a list from a text file and outputting the sort into a different text file that the user chooses. The text file that's inputted is about a 20 item list …

Member Avatar for Ancient Dragon
0
706
Member Avatar for bernaprog

hi, I'm trying to calculate the percentage of an ammount of boxes in C. Ex: 4400. I have the next code: [CODE=c++]#include<iostream.h> #include<conio.h> main() { double a=2400; double b=8000; double per=0; per=2400*100/8000; cout<<per; getch(); } [/CODE] and return a negative value. I try to asign values at differents variables like: …

Member Avatar for Ancient Dragon
2
121
Member Avatar for thammalatha

can any one tell me what is the difference between map and multimap container in STL? thanks in advance.. iam new to this topic..

Member Avatar for JasonHippy
0
93
Member Avatar for chris.vargas.773

For a Class assignment i wrote a program that has to throw a logic_error and then catch it but my code doesn't work i don't know what am i doing wrong. #include <iostream> #include <iomanip> #include <exception> #include <stdexcept> using namespace std; std::logic_error; struct MyException : public exception { const …

Member Avatar for Lucaci Andrew
0
695
Member Avatar for jayrharris21

Alright guys, brand new to the forum and I'm currently taking my first c++ course. I am not asking for anyone to do my homework for me, but I have been working on the same assignment for the past three days and have been unable to figure it out. Here …

Member Avatar for jayrharris21
0
553
Member Avatar for hartk1213

i need some help with my assignment the link is to the assignment [Click Here](http://www.cwu.edu/~schwing/cs361/CPPprog4.html) Complex.h #include <iostream> using namespace std; class Complex { private: double realPart; double imaginaryPart; public: //Default Constructor Complex(); //Parameterized Constructor Complex(double r, double i); double GetRealPart() const; double GetImaginaryPart() const; void printComplex(); }; test.cpp #include …

Member Avatar for hartk1213
0
407
Member Avatar for BevoX

This is my solution for generating prime numbers. With this code hopefully you can generate prime numbers with incredible speed. The generated numbers will be stored in a text file titled as "Primes.txt". I have a dual core machine, but this program does not support dual core architecture, so it …

Member Avatar for Microno
1
678
Member Avatar for nyfan68

I am working on a phonebook application and I am having trouble implementing the add and find functions in the phonebook class. I am not sure how I am suppose to implement the functions using the prototypes provided. Any help would be appreciated. #ifndef Name_H #define Name_H #include <iostream> #include …

Member Avatar for Schol-R-LEA
0
158
Member Avatar for salah_saleh

Hi, I have a problem in evaluating a macro in this code: #include<iostream> #define _A_ some #define Func _A_Func using namespace std; int someFunc(int i) { return i; } int main() { cout<<Func(1); } I get an error: test.cpp: In function ‘int main()’: test.cpp:13:13: error: ‘_A_Func’ was not declared in …

Member Avatar for Ancient Dragon
0
91
Member Avatar for jongiambi

Hi im writing a fill-in-the-blanks program and I am stuck on how to delete a node from a liked list. I am suppost to follow this psuedocode to finish the program. I think I am close to a solution, can anyone point out what im doing wrong? The list already …

Member Avatar for Ancient Dragon
0
282
Member Avatar for Vish0203

Hi, I'm working on a small project and i'm stuck in a part where I need to replace the existing word in file with a new one. I really have no idea about it.. I'm posting the function block where i'm facing the problem void team::team_list() { string str = …

Member Avatar for sbesch
0
157
Member Avatar for lior.mor.73

hi! i started my programming studies not a long ago. we work on c++ and somehow the program is not compiling on my computer. the software is legal, i installed and started it with no problem but when i do debug or build i always recieve this error at the …

Member Avatar for Lucaci Andrew
0
82
Member Avatar for vicky30312

I cannot get the math right for the higher option. When you run the program, the program will go lower, but it wont go go higher. What is it i need to change? this program is due by the end of my class today and i can't figure it out. …

Member Avatar for Reverend Jim
0
286
Member Avatar for anukavi

Hi, I have got an integer as 0010000001. I need to remove the last 4 digits ie 0001 and the remaining digits is 001000(this is expected) The truncation of last 4 digit is standard. ie the size of last digits is always 4. can anybody help me to code this …

Member Avatar for Lucaci Andrew
0
1K
Member Avatar for code_r

**Requirements** Write the following function: void splitDate(int dayOfYear, int year, int *month, int *day); dayOfYear is an integer between 1 and 366, specifying a particular day within the year designated by year. month and day point to variables in which the function will store the equivalent month (1-12) and day …

Member Avatar for Gonbe
0
138
Member Avatar for nyfan68

I have been working on this phonebook application for a few days now. I am suppose to Create classes Name, PhoneNumber, and PhoneBook that are employed by the provided phone book program, PhoneBookProgram.cpp. Class Name Represents the name for a listing in a phone book (example: Phil’s Pizza) Overloads stream …

Member Avatar for vijayan121
0
204
Member Avatar for chris.vargas.773

i'm having trouble with this assignment for my cs class the directions say "Make operator+ combine together the contents of two TrashCan, as long as the contents does not exceed the size. Make operator- subtract one TrashCans contents from another, as long as the size or contents don't go negative. …

Member Avatar for chris.vargas.773
0
121
Member Avatar for nmajon

i must do an project with sorting using priority queue..i find some things on books but the code was with classes and i don't learned about it ...please can halp me with some oppinion

Member Avatar for mike_2000_17
0
181
Member Avatar for andrew mendonca

Define a getTopTwoScores() function with the specification and prototype shown below: // Set highest to the score with highest value and secondHighest to the score with the next highest value. // If there are two highest scores with the same value then set both highest and secondHighest to that value. …

Member Avatar for andrew mendonca
0
366
Member Avatar for hister

#include <iostream> using namespace std; int main() { int n1, n2, n3, i=0; for (n1 = 1; n1 < 10; n1++) { for (n2 = 0; n2 < 10; n2++) { for (n3 = 0; n3 < 10; n3++) { cout << i << " " << n1 << " …

Member Avatar for deceptikon
0
197
Member Avatar for Everlight

Hello, I have the following code: `#include <iostream.h> void main() { double test=3.46578953218549; cout.setf(ios::dec); cout<<test; }` I understand that iostream.h is outdated and Microsoft Visual Studio has iostream. However, When I remove the ".h" the setf, ios, etc, line 6 has multiple errors. So, my question is: How do I …

Member Avatar for Everlight
0
3K
Member Avatar for GottaLove

ASsuming in class , i have: class math { private: int x,y; public: bool operator>(const math& ); bool operator<(const math& ); } bool Point2D::operator>(const math &p) { return (this->x > p.x); } bool Point2D::operator<(const math &p ) { return (this->x < p.x); } bool Point2D::operator>(const math &p) { return (this->y …

Member Avatar for deceptikon
0
198
Member Avatar for muhammad.khan.3576

#include<string> int str_len( const char * const src) { int len=0; while(src[len]) { len++; } return len; } int str_copy( char * &dest, char * src) // removed (const) to sore the string in dest.By using const,we dont have the // access to store the string.By using ampersand we can …

Member Avatar for Gonbe
0
143
Member Avatar for hilol9872

I pasted the code here: http://codepaste.net/hy5n6m . In that version creating a cypher is no problem but decrypting a code doesn't work. I've only gotten it to work a couple times and I lost those versions (because something else always went wrong there). I have a couple other versions which …

Member Avatar for BobS0327
0
246
Member Avatar for thammalatha

Hi, Iam using filestreams to create binary file (c:\\..\\abc.bin).I want to put some checksum when i try to open the file through programming ,like if it is previously modified through another application or done manually.At the point of opening the binary file i need to perform some checksum by checking …

Member Avatar for thammalatha
0
338
Member Avatar for andrew mendonca

Define a getScores() function with the specification and prototype shown below: // Get scores from console and return the number of scores recorded. // A negative value signifies end of input. // If more than MAX_SCORES values are entered then discard entries beyond the first MAX_SCORES. // Assume that MAX_SCORES …

Member Avatar for chaau
0
240
Member Avatar for 9tontruck

There are lots of flash video downloader out there such as "http://www.flashvideodownloader.org/" and I am sure you have seen it too. I am hoping to capture the url of a video file which is playing in a flash video player in C++ or C#. How can I do it? Would …

0
104
Member Avatar for spiderman.rapp

Write a program that prompts the user to enter 5 numbers then prints the largest and smallest number to the user. Add a while loop to keep the program running until the user wants to stop.

Member Avatar for Ancient Dragon
0
45
Member Avatar for prahesh

I want to sort the array items using the vector. Example: int buff[4] = {15, 6, 55, 34}; std::vector<int> myVector(buff, buff+4); now i will pass the array in to sort the buff data in ascending order. mySort(myVector.begin(),myVector.end()); How to do this ? Kindly suggest.

Member Avatar for mike_2000_17
0
230
Member Avatar for yxBen

HI people, First post here, please go easy on me :) #include <iostream> #include <array> int main() { using namespace std; array<int, 5> cppArr = {1,2,3,4,5}; //"missing braces.." error and unresolved symbol highlight return 0; } With "-pedantic -Wall -Werror" specified, compiling the above snippet in eclipse (using cygwin or …

Member Avatar for yxBen
0
676
Member Avatar for SphirosOkelli

I have written a code that reads and input file, does some silly little calculations with some functions. It's a schoolwork assignment, but its done :) With one small kink- I need to create an output file. Well, actually I can make the out file just fine. But I have …

Member Avatar for SphirosOkelli
0
151
Member Avatar for dalawh

Is there anyway to interrupt one program with another program? One program writes to a file, and the other one reads and prints a certain statement depending on what was read. I want the reading program to be interrupted when the writing program writes.

Member Avatar for mike_2000_17
0
235
Member Avatar for sabrimev

I get a compiling error in the main fuction 'cout << a.GetVect() ; ' I am not sure whether the problem is in the overloading function or in class. Anyone has any idea why I take this error? you can check the compiled code and errors in http://ideone.com/ODOJik Thanks in …

Member Avatar for sabrimev
0
169
Member Avatar for umerm04

Isn't the remainder should be 0? But in programming 2%5=2, 4%5=4 Please explain

Member Avatar for nmaillet
0
138
Member Avatar for coroshea

The prgram will only display one number. In this case 9. I switched, 9 with 6.71; and only 6.71 displayed. So what this means, only the 2nd to last node's value is displayed. Note that the display function is able to display the original order of the array passed to …

Member Avatar for coroshea
0
220
Member Avatar for Carc369

I will be posting bits and pieces of my code that is relevant. //Function Prototype int binarySearch(char*); // Binary search of dictionary. the Function I'm passing to. char* reverseTruncateCipher[80]; <---- variable I'm passing. /*I have these variables stored in them reverseTruncateCipher[0] = all reverseTruncateCipher[1] = generalizations reverseTruncateCipher[2] = are reverseTruncateCipher[3] …

Member Avatar for Ancient Dragon
0
227

The End.