I'm using MSVC++ and it builds sucessfully but somewhere something is obviously messed it. Once i try to debug it just shows weird numbers.
int k=0; //could this be the problem??? since 0 would be over writing any given value. but if i leave int k; it showsa warning and MSVC would count that as an error
The program will ask for the user to enter a value for x, then compute the following polynomial: 3x^5 + 2x^4 - 5x^3 - x^2 + 7x - 6.However, when I double check it with my calculator I get a wrong answer for random values of x. To simplify my problem I'm using only integers.
Code:
#include <stdio.h> int main(void) { int x, polynomial; }
I am trying to write a program that can communicate over a very latent internet connection involving a cellular modem. I have some software packages that handle all the telnet like business and will pipe stdout and stdin to a program I can have it execute.
The problem I am running into is that I have to send about 900 ASCII commands to an instrument to request data but it takes about a second between when a command goes out and when a reply comes back. This will wind up taking a very long time and I am looking to speed it up. All of the commands are independent of the reply so what I need to do is create a program that can send all 900 commands with maybe 10ms break between them and to not wait for a reply. It then needs to read the replies and write them straight to a file.
It seems like this should be achievable in C++ but I only have a very basic understanding of the language and thus am not sure where to start.
I am open to using other languages but thought C++ would be a reasonably good start so I can distribute the program to my coworkers. All of our work machines are Windows but if there is a simpler solution from Linux, I should be able to work something out. I'm just trying to avoid complication.
I am making a program which is going to print out a head image according to the input values entered by the user. Here is the code:
Code: #include <iostream> #include <string> using namespace std; void Sides() // draws the sides to take proportion
[Code] .....
At first i tried to work program like:
Code: cout << "plase enter which way you want to print out the head, with parted hair or bald." << endl; cin >> headstyle; if (headstyle != "bald" || headstyle != "parted hair" )
But it also had given the same mistake. The program compiles BUT; even if I put in the values bald or parted hair the program prints out "wrong input" then exits.
I'm working on a project that requires to make modifications to certain functions. So, I'll copy and paste the function to a new source code so I'm just working on the function with the entire program running. When I run the function by itself, it works fine. But when I copy and paste the function back to it's spot, the program doesn't wait for input at the cin.getline & it did wait when I ran just the function by itself. I'm using Dev C++ if that makes a difference.
using namespace std; //class declaration class dayType{ public: int presday;
[Code] ....
So everything works perfectly, well not everything lol. Code compiles successfully without any errors but previous day does not calculate. In a sense that when it asks for number of previous days it returns a blank statement.
For example: Previous number day is: shows nothing
I just dont see what the issue is here. I have stared at this thing forever. Im trying to make a calendar from scratch so I can be prepared for my second test on Friday.
Code: #include<stdio.h> #include<stdlib.h> int main(void) { int i, n, s;
So, ArrayList *myList should return a pointer to the new arraylist or null if malloc fails. what exactly I need to set my maximum to, I know that it shouldn't be 0 and array[i] doesn't seem to be working either. I also am not sure if I am properly setting up null correctly for my array.
#include <iostream> #include <string> using namespace std ; int main() { string bored ; do { cout << " program" <<endl ;
[Code] .....
I made this as a simple do/while program, and if i run it, the second do/while statement will keep on going forever, without the [cin >> bored;] line working?
I just wanna have a very simple function that reads values from a text file row by row. The first value is passed along from the stringstream to my float data[] but after that it doesn't pass along anything. The strange part (for me at least) is that the stringstream contains the values it should contain, but they doesn't wanna end up in data[].
I've implemented it a bit differently: I create 2 temporary arrays, one for the numbers lower from the pivot , an done for numbers greater then the pivot. in the end of each iteration the 2 arrays are copied to the original array:
Code: #include <iostream> void QuickSort (int* A , int start, int end){ if (end-start<3){ return; } int mid=(start+end)/2; int pivot=A[mid]; int lA[end-start] , rA[end-start], rCounter=0,lCounter=0; int curr=0,i=start;
Numbers are 3d6 Rolling die no.1... RolledDie: 4 DieTotal: 4 Rolling die no.2... RolledDie: 5 DieTotal: 9 Rolling die no.3... RolledDie: 5 DieTotal: 14
I am trying to release my C++ app to run on desktops that dont have VS installed and have created an install shield app to install on the desired computer. my issue is even after packaging it, it still requires certain DLL's...I read online that I had to copy 'msvcr120.dll' and a few others to syswow64 and sys32 folders but now when I try run my app it just crashes before starting.
I think it sucks that Microsoft no longer packages required DLL's like it used to in 2010.
I'm trying to build a new project and i installed some new libraries in it but when i try to compile any code it doesn't give me any value just press any key to continue, i didn't make any files but one and even if i tried to do this simple task it doesn't cout any result:
#include<iostream> using namespace std; int main() { cout <<("ha"); system("pause"); return 0; }
I wrote a program which was supposed to decrypt a file encrypted with the XECryption algorithm. Now, I know the decryption algorithm, but I have a problem with my ifstream object. It doesn't read anything at all, and the ofstream object just outputs a single random byte in a never ending loop. I've tried using cin, which works correctly, but it's not what I want.
Here's the code:
#include <fstream> #include <iostream> using namespace std; int main() { ifstream in("file.in", ios::in); if (!in.is_open())
[Code]....
I'm doing this on a Windows 8(.1) pc with Code::Blocks 13.12. In the file (file.in) I have replaced the points with spaces. What is wrong with the code?
Ive been having a hard time creating bin file. Whenever I append data, the data wont show in browse function. And this program works good without the bin file code.
I am trying to change the value of of time in my vector of structs. The result should output 1430 as the value of shares[1].time though I get something different.