49,761 Topics
| |
Hey guys, I've written quite a large piece of code the past few days, and today I've cleaned it up a bit, divided it into functions (I know, bad, should've done it the other way around) etc. etc. The project is a simple 3D thingamadingy, the program is able to … | |
Does anyone know if vs2005 has the borland equivilent of a "scrollbox"? Thanks. | |
I'm new to C++ and trying to find a compiler I tried using visual 2008 but it didn't work... then I re-installed it and can't even open it so I need to find something else I need something thats noob-friendly and is updated thanks | |
I need my output screeen to looklike this. So far i can do all of it except my traingle comes out in a right angle and i dont know how to make it into an traingle shown below. Ive tried usind 'setw" but it doesnt seem to be working. [B]This … | |
Hello friends..[B]Ugly number is a number whose prime factors are only 1,2,3 or 5.[/B] I had written a program for finding n`th ugly number in the series.Now the series is 1,2,3,4,5,6,8,9,10,12,15...these are first 11 ugly no`s. Now In my program if we put m=11 then output will be 15. It … | |
I am writing a program which reads in a database of albums into an array of structs, the data can then be deleted, modified etc. The problem i am having is that when i try to modify a specific record using a search term and then strcmp to the album … | |
I have a line to pharse like this: 1.2 2 3 4 5 2.4 2.4 2.6 3.5 5.6 3.7 3.4 4.7 3.4 56 I need to sort them in a map of string and vector<double> The problem I'm having is I'm trying to get each colum and store it in … | |
[code] #include<fstream.h> #include<string.h> using namespace std; class emp { public: char *per; void write() { ofstream out("ss.txt",ios::app | ios::binary); cout<<"Enter some character ....\n"; cin>>*per; //out.write(per,sizeof(per)); out.write(per,strlen(per)); } }; void main() { emp e; e.write(); } [/code] Why this is not working? | |
Example: There are literally hundreds of programming languages. The number of nonblank characters is : 48 So far i have come up with: for (cin.get(inputLetter); inputLetter != '\n'; cin.get(inputLetter)) { if ((inputLetter >= 'A' || 'a') && (inputLetter <= 'Z' || 'z')) numUpper++; } | |
Hi, I have got to the section on command line arguments on my online textbook. All the information I can find on it seems to assume that I know how to put command lines into my program but I don't have a clue :$ Can anyone help? | |
#include<iostream.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> class array { private: int A[20]; int ele; public: void input(); void display(); void bub_sort(); void insert(); void del(); }; void array :: input() { int i;char ch[20]; for(i=0; ch[0]!='x'; i++,ele++) { gets(ch); A= atoi(ch); } ch[0]=0; ele=(ele-1); return; } //======================================================================== void array :: display() { … | |
I have a problem where i want to compare strings, however the comparison cant be case sensitive. I have tried to use stricmp strnicmp strcmpi They do not seem to be part of the <string> or <cstring> libraries on my compiler. I am using the GNU compiler. Is there a … | |
Hello all, I am in need of some assistence. So if anyone could help that would make my day;). This is a piece of my code [code] for( int i = 0; i <= 13; i++ ) { cout << "SLOT : " << slotNumber; fprintf( HashTable, "\t%i slot : … | |
[CODE]#include <iostream> #include <vector> using namespace std; // global constants const char X = 'X'; const char O = 'O'; const char EMPTY = ' '; const char TIE = 'T'; const char NO_ONE = 'N'; // game function's prototypes void displayBoard(const vector<char>& board); // function that displays the game … | |
[code=cplusplus] #include <iostream> #include <string> #include <stack> #include <cctype> //alnum #include <cassert> //assert using namespace std; #include <sstream> string infixTOposfix(string); int evaluarRPN(string); int main () { // main began string infix, posfixWspaces, dummy; double result; char repeat; do { cout << "\nPlease enter the expression in INFIX: "; getline(cin,infix); posfixWspaces … | |
[CODE]#include <iostream> #include <vector> using namespace std; // global constants const char X = 'X'; const char O = 'O'; const char EMPTY = ' '; const char TIE = 'T'; const char NO_ONE = 'N'; // game function's prototypes void displayBoard(const vector<char>& board); // function that displays the game … | |
Right now I am learning how to use C++ programming on Linux. I just learned how to copy a file, now the question is, how can you tell if a file has been copied or not? I think I need a command or a function that allows me to check … | |
Hey could someone help me bout my problem.... can someone tell me how to make an asterisk frame using for loop statement in C++ and also 1 thing.... how can i display an input letters into an asterisk... eg.. username: bulbulito password: ******** | |
Hi,im new to c++, i use Dev-C++ to compile my programs i have little problem with ofstream function,i think you guys can help me What program does? Lets say my Computer name is nixon-pc. Program displays text in cmd: "File nixon-pc.html has been created" and than create file C:\nixon-pc.html . … | |
How do I convert a char* or an unsigned char* to an unsigned int? | |
Guyz I Don't want to write another array function using VOID I wanna do it using pointers for the extra grades...... can ny one give me a clude or just6 a sample code snippet on how to return a 2-D array ?? I have to fing sum of upper half … | |
I'm having some trouble on deciding to purchase Scott Meyer's Effective/More Effective C++ books or Herb Sutter's Exceptional/More Exceptional C++. I'm assuming both cover the same concepts, but I could be wrong. Opinions/Votes please from C++ programmers that found the one they read useful. There's also an option for both … | |
I wish to create a program that will be a quiz game (multiple choice) questions I need to be able to display it and the options and allow the user to use the mouse to click to the option which he thinks is the correct answer. My answers will be … | |
Also do tel me what is the process of creating functions in seperate files and referencing them under a single file. I use a dev-C++ for my coding | |
i need help on this question. any kind souls can help me? with great thanks. ive already done some part of it but still cant get it working [code=cplusplus] #include <iostream> #include <string> using namespace std; class court { protected: string name, ic, telephone, fn, day; int time; public: court(){}; … | |
[CODE= CPP] //Searching for specific characters while (!stats.eof()) { stats.getline(counter,200); for (int i=0; i<strlen(counter); i++) { if (isupper(counter[i])) upper++; if (islower(counter[i])) lower++; if (isdigit(counter[i])) decimal++; if (isspace(counter[i])) blank++; if (counter[i] == '.') end++; if (counter[i] == '!') end++; if (counter[i] == '?') end++; total++; } } [/CODE] Hi guys, I … | |
The issue I am encountered with is… the same vector we read as double is to be used in another function, but with different data type as mentioned bellow. So I need a conversion function which performs this fact. I have a class as follows [code][i]template <class T> class NRVec … | |
In some of my programs I encounter error message in the middle of the successful start without debugging.... is there a code showing the reason of the error message? | |
guys, can u help me make a lexical analyzer that outputs invalid/valid only? it would really help if you guys help me with this. this is my midterm project. thanks!! | |
Hey ppl, Im currently writing a code for the following problem. " Problem Statement ***Note: Please keep programs under 7000 characters in length. Thank you Class Name: SquareDigits Method Name: smallestResult Parameters: int Returns: int Define the function S(x) as the sum of the squares of the digits of x. … |
The End.