49,761 Topics
| |
Can anyone help me with this program?? Professor asked me to create a program that permits a user to enter a maximum of 50 characters into a stack Object, then have the program sort the stack contents into increasing order from A to Z. Is there any way i can … | |
Hi, Can anyone pls let me know the reason as to why do STL - [B]Container Adaptors[/B] types do not support the use of [U]iterators[/U] for iterating through their elements? Thanx | |
[CODE] ifstream inputfile; cout << "enter the name of the file: "; cin >> filename; inputfile.open(filename); string temp; int i = 0; while(filename != NULL) { while(isalpha(filename)) { temp[i++] = filename; } if(i > 0) { insert(temp, 1); i = 0; } } [/CODE] this is my code, what am … | |
I have an assignment question that says "Decide whether the [I]syntax[/I] of the following statements is valid or invalid." These are the statements: [code=c++] a) listData->next = ptr1->next ; b) listData->next = *(ptr2->next) ; c) *listData = ptr2 ; d) ptr2 = ptr1->next->info ; e) ptr1->info = ptr2->info ; f) … | |
Hi all, The program I'm making needs to basically interpret long math operations (see the attached text file) and compute them. Simple right? I have to use stacks and queues to reorder the operation into the desired output (the output will compile properly if you run the program as it … | |
I did a program to read the output of the UNIX command ls -ali and count the number of directories, write files, link files etc. But there seeems to be something wrong with my code and I cant compile it. I cant seem to find out whats wrong with it. … | |
Hi, I'm making a program that will get input from a user's microphone, send it to another user with a socket, and play it. It's like a VoIP thing. I can send data using a socket, but I have no idea how to get input from a microphone or play … | |
I have a problem in the book (not for homework) that says. List Reverse Modify the linked list class you created in the previous programming challenges by adding a member function named reverse that rearranges the nodes in the list so that their order is reversed. Demonstrate the function in … | |
Hi. I've been trying to find out how to use Gui in C++. I use Bloodshed Dev.-C++ and so far I haven't found anything on how to do it. Could someone please help? | |
hey, given one side and an angle how do you calculate the other sides and angles in a right angle triangle in c++. I'm basically looking for an algorithm. Thanks drjay | |
Hi! I wrote this program to generate a keyboard determined random numbers. [code] #include <stdio.h> #include <stdlib.h> #include <time.h> int amount, aleatory_numbers; int array[70]; int counter=0; int generator () { printf ("Introduce the amount of numbers that you wish: "); scanf ("%d", &amount); srand ( time(NULL) ); do { aleatory_numbers … | |
I'm trying to use new but I can't seem to get it right... in this example I ask how many strings the user would want to input, then ask for each one, then echo them back. [code=c++] #include<iostream> using namespace std; int main(int argc, char** argv){ int num, i; char** … | |
My program needs to use exponents, however, double does not allot enough space for my numbers, is there another way to use the pow(x,y) function or is there another function for exponents that I'm overlooking? [CODE=cplusplus] #include <iostream> #include <cmath> using namespace std; int main(void) { int thresh = 10000; … | |
I'm trying to write a class that will read and organize the command line arguments of a program. Like, it will read -a as a 'switch', and --abcd as a 'switch' and you can define different switches as having parameters, so -a bc de fg will have bc and de … | |
Why we use main() function in c and c++? please reaply as soon as possible. | |
I'm trying to read a single letter from the beinging of a string that is generated from user input. Though it sounds childishly easy, I think I may seriously have a heart attack from trying to solve this problem. Example code follows: [code=CPP] #include <iostream> #include <string> #include <sstream> #include … | |
hi guys..! i need some help on how can i print out the output of my program.. the problem is, it will only print out the first char of a characters and i don't know how to use the pointer using an multidimensional array. ex. input: jhonny output: j here's … | |
Hello everyone I am new to the forum I have a question. I created a method foo(ifstream &myfile) and works only if executed ones. In a loop or consequtively calls make the cerr call [code]int foo( ifstream &infile){ if (!infile) { cerr << "Unable to open file "; return -2; … | |
Hello I wanna ask is it possible to to us vb for building a program's GUI and c++ for its coding? | |
For a class project we are to implement four types of sorts that they give us, and for the most part i have that working, but i wanted to know what would be a good data structure to use? Atm im just making an array, if it fills up, i … | |
Hi All, I am working on a project and have come across a slight problem. I have a file i am reading in that consists of the following: John Smith 333222333 01/01/80 M z11119 cs111 2008 fall a cs222 2009 spring f The first line is the Students information, the … | |
Hi am trying to make a simple application that write and read from and to a text file the problem is that i want to be able to aerch in the text file for an specific line. the text file is a list of words with a meaning each word, … | |
This is homework and I am using a getfile that is just a 5 row 4 column list of numbers. I can get this program to compile and when I go to run it, I get my cout text output but without my numbers and the program crashes. I am … | |
Hello, I'm relatively new to c++, so I would appreciate any help. This must be a very basic issue, but how is it that one can assign a stuct or class member to a pointer instead of that structs or class member's address (via &)? (from stroustrup) [code] struct name{ … | |
Hi all. I have just started using Qt, and i can't find any primer on how to connect my Sql Server2008 database. What are the steps that i need to make, so my database is connected with Qt. Additional info: I'm using Qt 4.4.3 open source on Windows XP and … | |
Hello, I'm trying to implement a system of resource managers. There's a ResourceManager template and its templated member function which will attempt to create a resource from whatever _Creator had been passed (if the given resource can use the given creator class). The _Creator is just an aggregation of information … | |
I have a code snippet that strangely works one way on a fedora 6 machine and another way on a fedora 8 machine. [code] void Form1::SendToApp() { vector<int> isciistream; vector<int> fontstream; cout<<"Entering Form1::SendToApp()"<<endl; isciistream=wwnd->OnOK(); isciistream.push_back(32); char str[255]=""; cout<<"Size of IsciiStream:"<<isciistream.size()<<endl; for (int i=0;i<(int)isciistream.size();i++) { sprintf(str,"%s%c",str,isciistream[i]); cout << "isciistream[i] :" << … | |
Hi Everybody, I am new to C++,but strongly it is recommended to learn C++ for its speed. That is why I'm here.Could you help me about it. Where do I should start from,read which book and etc. Thanks in advance. | |
Hello everyone, I'm a moderately experienced C++ programmer who has decided its finally time to learn socket programming. I want to learn by writing a simple client/server pair of apps. The client will send a simple text string across the network to the server. So far, I've only worked on … | |
I have implemented ReadFile function for reading data through SerialPort.When the other end is responding correctely my program is working fine. Sometimes when I dont get data from the other end my program hangs.For this I have implemented timeouts for Readfile function. But It doesnt seem to be working. My … |
The End.