- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I've been trying to fix a problem with getline() and cin.getline().Here's a example I've made and it still has the problem: [TEX]" No matching function to 'getline(std::istream&, char[100])' "[/TEX] Here's the code: [CODE] #include <iostream> #include <windows.h> #include <string> using namespace std; int main() { char name[100]; cout << "\nEnter … |
|
Re:
hello friends, i hav my very own forum but its hosted in a free hosting site called invision.. now i hav my own webspace and i want to have my own forum in that webspace. i don kno how to start with or is ther any software that can help … |
|
While coding a random Employee storer, I use Scanner, and its .nextInt(); to ask the user for the employee's contact number: [CODE] Scanner Scan = new Scanner(System.in); out.print("\nEnter Employee Contact Number:"); newEmployee.contactNumber = Scan.nextInt(); //(I have a class Employee) [/CODE] I get the error : [CODE] Enter Employee Contact Number:456645 … |
|
Re:
Hello friends, I need some help with my c++ hangman code.The code is below. [code] /*Game of Hangman Author - Chirag Mittal */ #include<iostream.h> // For input/output #include<fstream.h> // For file input/output #include<string.h> // For strcpy #include<time.h> // For time #include<stdlib.h> #include<ctype.h> //for toupper & tolower #define MAX_WORD_SIZE 15 // … |
|
Is it just me or is there less people in the C++ and Java Forums now? When I signed up sometime 2008, it would be buzzing with activity and people would post heaps and receive answers quick, maybe in around 5 - 20 minutes, but I looked through the last … |
|
Re:
What is the best way to assign values to variables of various data types from reading a file (while importing as few things as possible and making use of the simplest code)? I need to write a program which can assign values from a .dat file, if that's relevant. If … |
|
Hi, I'm having a problem with reading from the char , coupon, and it comes up with an error saying [CODE]Exception in thread "main" java.lang.NullPointerException at input.Main.main(Main.java:27)[/CODE] At the line which I read from the char, which is that myScan.findInLine bit, I am working from a beginning java programming book, … |
|
Fail :icon_exclaim: :icon_lol: [url]http://www.youtube.com/watch?v=25UJlRd3lKs[/url] *Not Mine Though -_- |
|
Re:
oh my please help me..i;m making a simple code in c++ using dev c because i am exploring this language for my second year. i do not know why it will not display the output..i don't know how to use cin..[CODE]#include <iostream> using namespace std; int main() { cout << … |
|
Hey guys, is there anyway a C++ program will continue to execute and not pause when I run a program for it? E.g I've already got [CODE] system("iTunes.exe.lnk"); main(); [/CODE] It calls main after it executes the program, but it is paused until I exit iTunes, is there anyway to … |
|
Re:
Hi guys, I do need a c++ programm which may "Count vowels in monosyllabic,two syllable and longer words within a string/sentence" bye. |
|
Re:
Hi, I'm a complete noob to C++. I am currently just making text games where you input a string and depending what that string is and what you have in your "inventory", the program will cout something else. I would like to know how i would be able to save … |
|
Hi, whilst reading a book on Java, I came across a bit where the author used [CODE] GregorianCalendar now = new GregorainCalendar(); [/CODE] And I was just wondering, is that any different from [CODE] Calendar now = Calendar.getInstance(); [/CODE] And if so, why did he use GregorianCalendar instead of the … |
|
Re:
Hi! I have this simple movie-list that I wont work, I get compile errors on this simple program. Could someone please help me to get this to work, should be very simple for you guys =) Thanks in advance! Here's the code: [CODE]#include <iostream> #include <cstdlib> #include <fstream> using namespace … |
|
Re:
how to make a my program to finish repeated the loop when the user enter the sentinel value?? for example the "-1"... this is my attempt..but still something wrong here.. [CODE] #include <iostream> using namespace std; int printreverse(char letter_box[],int i) { for (int x=i; x>=0; x--){ cout<<letter_box[x]; } } char … |
|
Re:
write a programm which out put is a triangle example 5 4 4 3 3 3 2 2 2 2 1 1 1 1 1 |
|
How do you make a C++ Program run at start up? I'm using Vista, and when I right click the start button and press open, it comes up with my programs in the start menu, how do I get to the Start up Folder?:S |
|
Re:
[CODE]#include <iostream> #include <iomanip> using namespace std; int main() { string name; char indicator = 'c' ; // Input indicator char answer1,answer2,answer3,answer4,answer5; int count1,count2,count3,count4,count5; cout << " Welcome to Risk master, answer those 5 questions to calculate how risky your partner is"; cout << " Rule : press Y for … |
|
Hey, Im trying to get the user to type in a file name, and then the program will copy the file to some where else like C:\ or USB or something. So far this is what I've come up with: [CODE] #include <iostream> #include <windows.h> #include <stdlib.h> #include <conio.h> #include … |
|
Re:
This is my next question: how to get a document from root? because I have this code: [code] myfile.open ("/home/ws14/Desktop/test.txt"); [/code] But I need to change the path home/ws14 if I change user. Thanks! |
|
Its been a while since i realised i didn't know how to mark one of my threads as solved.:$ Any help will be appreciated...:) |
|
Hi, I have a question with ofstream, is there anyway to ask the user for a file name, then create the file, and write to it? Like: [CODE] string file; cout << "Enter filename:"; getline(cin, file); ofstream ofile; ofile.open(file); ofile << (stuff....); ofile.close; [/CODE] ...except that doesn't work properly.:S Thanks … |
|
Re:
If i have an array like that int x[100]={1,0,3}; so only i have 3 elements and the rest of the array is zero, how can i count the number of elements in a larger one .. |
|
Does anyone know a decent site for studying about ctime(or time.h) in c++ thats good and doesn't end up telling you its in C?:@ :-/ Cos' when I search on google and I when thought I had found a great site, its actually for C programmers. Any help would be … |
|
I'm working with structures, but somehow it skips one of the user inputs for the pie's price: [CODE]#include <iostream> #include <windows.h> #include <string> #include <conio.h> using namespace std; const int ESC = 0x1b; struct pie{ string brand; float price; string flavour; }pies[5]; int main() { cout << "Structures."; cout << … |
|
Ok, Im not trying to be evil or anything but is there anyway I could use C++ to open a website in a window, then record what the user types? So the website is google, and some random guy decides to search up dogs:twisted: , dogs would be recorded some … |
|
Re:
CIS350 Project Choose one O(n log n) and one O(n2) sorting algorithm. Choose a third algorithm of any time complexity. For each of the three algorithms you have chosen, implement the algorithm. Then, write a short piece of code that will generate the following: 1. A file of 1000 random … |
|
I just knew about getch() and found it better than cin (a lot) but there's one problem bugging me, can you makea n if statement for getch()? For example they have: [CODE] int a; cin >> a; if (a == 1) //blah else if (a ==2) //blah else //blah [/CODE] … |
|
Re:
hi all i am beginner .i am building a website with dw-8.my screen resolution is 1024/768.i have been made web pages for site but when i open thoe pages in laptops or other computer they did not fit on size.so what size i choose so that in different-different resolution of … |
|
Re:
hey, This might be naive, but how come this bit of code isn't working??? [CODE] int lc=0; read.open(filename_user.c_str(), ios::in); while(getline(read, linecount, '\n')) { ++lc; }[/CODE] Have looked through the internet, and this code seems to be fine, so what is it that makes it not work?? the output is always … |