49,757 Topics
| |
String swapping Output: Input name:Kitty yittk Thanks | |
i need little help of urs in the above code, RightFrom Function is perfectly working but there is a logic bug in LeftFrom Function. when i m sending North as argument the result from LeftFrom is -1 but i need 0. help me to solve this issue. [code]#include <iostream> using … | |
Hey guys appreciate u can help to do this: Write a program to implement linked lists to handle large integers. Since we cannot store big integers in any of the primitive types, the only way is to manage each digit as a node in the linked list. Take care that … | |
Please let me know how can i use the container classes and STL in c++,shall i need any S/w or C++ IDE is enough? | |
Hello, i'm learning to work with loops and it was fine untill it came to nesting loops. In an exersize, i was told to use nested loops to display a pattern of asterisks like this: (2 asterisks, 4 asterisks, 6 asterisks, 8 asterisks, 10 asterisks, 12 asterisks) ** **** ****** … | |
Hello everyone this is my first post. My problem is reading from a text file. The file is in the format: name\tdouble\tdouble\tdouble int Since I have no control over the format of the file and do not know the size, I first begin by counting the lines of the file(nLineCount2). … | |
hello, I am working on a little database program in C++ that writes to a text file, saves, and then reads the text file into array's, but i'm not real sure how to go about converting the information in the text file back into arrays. the text file looks like … | |
Hi I am testing myself by making a simple program that reverses the contents of an array. It works for some values but the last value of the array is not correct. Can you take a look over my code to point out where its going wrong? the original array … | |
Hi I am making a program that reads a string, when it finds a '.' character it changes the next character after the '.' to uppercase. My problem is, I am trying to take a string with 5 arrays (string line[5]), & extract the 1st character of line[0], then the … | |
[code=Cplusplus] file.open("1.txt"); file.seekp(pos,ios::beg); getline(file,temp); file.close(); [/code] i ve this small code where temp is string data type. suppose the value of pos points to a location yet to be filled with data, what would be the value stored in temp? is it NULL? temp is not been initialised by any … | |
Hello, I am developing a program that will read files with many lines of text (perhaps 20 thousand), and to look for a text on each line, hit the text, perform a function. I have a problem because the files have as many lines, the program will be very slow, … | |
Hi I am making a program that reads a text file & displays them into an array. My problem is; I read the text file to determine how big the array needs to be, then I clear the input from the text file, then I read the text file again … | |
I was coding for a particular problem whose time limit was 2 seconds.. The no. of input was max 300000. Simply taking in the number using cin and outputting the same number with cout will take more than 2 seconds. Any ideas on how to increase efficiency?? | |
Without using some new language like Perl, how would one be able to access a web-page, given specific session information? And also, which C/C++ libraries are good for doing this kind of job? If this is at all a weird question, I'll explain. I'd like to be able to write … | |
Im developing software that will handle alot of files & i was wondering what the best way of doing this is. There's a couple of things that are important. 1) i want to be able to access the files easily and have them grouped. 2) i want the files to … | |
So in a binary tree the insertion looks something like this: [CODE] void btree::insert(int num) { if(root!=NULL) { insert(num, root); } else { root=new Node; root->data=num; root->left=NULL; root->right=NULL; } } void btree::insert(int num, Node *leaf) { if(num< leaf->data) { if(leaf->left!=NULL) { insert(num, leaf->left); } else { leaf->left=new Node; leaf->left->data=num; leaf->left->left=NULL; … | |
[COLOR="Red"]Check out the red highlighter below, how can you sum the studentMark[MaxSize] for an average. For example (78.5 + 66 + 73 + 56.5 + 88.3 + 64.5 + 45 + 57) divides actualNum = average. I've been figuring that one for hours! [/COLOR] [code] #include <iostream> #include <string> using … | |
heey guys.. i have this h.w.. i solved the first part which is based on the second part.. but not sure whether i did it right or not.. can someone check plz.. this is the Q.. i only did the first part! First create a one dimensional array called numbers … | |
i read a thread in this forum about hardware programming with c++. thats something i'd like to do. i wanted to start on the parallel port and so i looked up some parallel port tutorials. later on i thought to myself... wait.. i dont have a parallel port comming out … | |
This is a program to find the least common multiple of numbers 1 to 20. I dont know why it doesnt work. Somebody please help me out [code=c] #include<iostream> #include<conio.h> #define A 100 using namespace std; int i; bool IsItDiv(int); int main() { int num=21;bool tf; tf=IsItDiv(num);cout<<"The number thats divisible … | |
Hi guys need a bit of help, i am making a prgram but i am stuck. I am displaying 9 8 7 6 5 4 3 2 1 and i ask the user to put in order,. So like 1 2 3 4 5 ...etc. Now i need it so … | |
I wanted to know an efficient algorithm to calculate the product of divisors.. My brute force method is giving me a Time limit exceeded. | |
Hi! This is my first post, so be gentle.. :D I am learning CPP with a book called "Beginning C++ Game Programming", and I have run into a problem. The book asks me to make a program were the user can enter his/hers favorite games, delete a game, and print … | |
[code=cpp]#include "stdafx.h" #include <iostream> #include <iomanip> #include <cstring> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char s1 = ""; char s2 = ""; cout << "Input String1: " ; cin >> *s1; cout << "Input String2: " ; cin >> *s2; if ( strcmp( s1, s2 ) > … | |
Umm... Im New To c++, But Not New To Programming Lemme Tell you All About Me Before Yu All Pile On Me! Im Only 14! I Can Program basic Online Codez :CSS and HTML. I Can Also Program Visual Basic ( 3/4 of it) My Question About C++ is Can … | |
I just wanted to post the code I wrote for an OO C++ solution to solving sudoku puzzles. I'd like to invite anyone to ask questions, give comments, or make critiques on the methods or algorithms in the code. For a recent job interview, I was tasked with writing a … | |
i am writing a program with threads. it's a simple program in which user will enter how many number of thread he want to be created. what technique we use to create multiple threads ?? using for loop ??? suppose to run 3 threads... [code=c++] for(c=0; c<3; c++ ){ pthread_create(&thread[c], … | |
Design an Employee Information System for employees of Super Shoppy The employee master should keep employee specific information. For each employee, details of all dependent family members are also maintained. There may be one or more family members for an employee. The menu base program should provide following options… … | |
Hi there, I have been trying to figure out the common recursion problem given in e.g. 6.42 in the following link: [URL="http://net.pku.edu.cn/~course/cs101/resource/CppHowToProgram/5e/html/ch06lev1sec28.html"]Towers of Hanoi[/URL]. After a few hours I still can't figure it out, even though I've got the code: [CODE=cplusplus]#include <iostream> using namespace std; // num disks void Towers(int … | |
I was trying to find the number of zeroes in a factorial of a number. The time limit was 2 sec. Max number of test cases being 100000 my code is as follows [code=cpp] #include<iostream> #include<cstdio> int five(int number); int two(int number); using namespace std; main() { int num; int … |
The End.