Just using Find in my source code to look for variables or whatever, works once or twice then just stops - Doesn't find anything even if it's there. If I restart VS it works again, but not for long.
I'm having troubles with this program I made. Put it simply, it's a basic program using Queues. Whenever I try to input a value, my compiler(Dev C) suddenly stops working. The .exe file crashes and I've no way on how I can execute my program.
Code : #include<iostream> using namespace std; int *queue; int rear, front, queueSize; void enqueue(); void dequeue(); void display();
I'm making an apllication which needs to play .wav file when user type something inside QTextEdit. I made some code but after minute or less the sound stops, so I made silly workarround. After 30 clicks I invoke sound->stop(); and then the loop start again, that works, but it's not good, can you give better solution. Here is my code:
i need my code to stop outputting all the numbers throughout the steps it is going through i just need it to output the total
this is my input M C C C L I V
and its output is
Your total is 1000 Your total is 1100 Your total is 1200 Your total is 1300 your total is 1350 Your total is 1351
i just need it to output the last number
// write a program to read a string of characters // that represent a Roman numberal and then convert // to Arabic form ( an integer // input from data file
Basically I'm having trouble reading more than one character.I want the user to input character traits(ie, w, a), if two traits are entered they get the job.
But I cannot get my program to read more than one character input.
This is what I have so far...
#include <iostream> using namespace std; int main(){ char input; int count = 0;
I want to do simple program to capture some 5 surnames of people(employees) - using array and pointers. Well I understand a bit of arrays and I know how to loop through.
How can achieve this? This holds the key to my understanding how pointers work and can be used with char or strings.
fprintf(stderr, "Data is %s when first entering ins_llist loop. ", data); q = malloc(sizeof(struct lnode)); if ( q == NULL ) return(NULL); }
[code]...
Trying to figure out a way to sort as i enter my data into the llist. What is in red and blue is what I've been messing around with to try and see if maybe i can get it to sort but it is not. When i flip sign, the order changes opposite, but i cant see how to sort each item as i go. Maybe i am too tired right now, lol, been working on this program for what feels like 30 of the past 24 hours haha.
I have a small program to calculate the value of salary. I want to user to be able to enter more than one user using array and finally calculates the average salary of all users.
Here is the code
Code: #include <iostream>#include <conio.h> using namespace std; int main() { const int months=3; double net_pay; string EmpName;
I've seen some threads that include the information about what data types one has to use usually to put a number of 12digit. But honestly speaking none of them works for me & it takes me a lot suffering about the data type. Even I've googled but I didn't get any specific result.
So, which data type I'd have to use to enter 12digit number.
I'm writing a code to find the largest prime factor of the number 600851475143
I'm trying to solve the ferry loading problem using two queues. My problem is I can't enter in data after the first set is scanned in, I'm assuming there is a problem with my loop, such that the scan function doesn't get called after one iteration. In the example I marked the data I can't enter. An example correct input would be:
correct input: 1 - can enter data20 4 - can enter data 380 left - can enter data 720 left - can't enter data 1340 right - can't enter data 1040 left - can't enter data
Okay, so my assignment for my C class is to generate a program that will allow the user to enter data for a stock and calculate the amount of stocks that ended up being positive, negative, and neutral.I tried to do this using one stock, here is my code;
I have the following code and I am trying to do simple math calculations to the data. I need to take the car price (y) minus down payment (z) and then divide that quantity by 12 times "yearsx" That answer is then assigned to x. The problem is that x will not print the correctly!I also noticed that if I increase the "count" to amnything higher than the number on lines in the file, I get the correct value for x but only on the last set of the struct..my file reads as follows:
last_name first_name car_price down_payment years johnson bill 10,000 2,000 3
When I printf the struct to the screen, i need to do the following:
x = (10,000 - 2,000)/(12*years);
but this is the math part that wont work. I have checked and doubled checked number types and I cant get it right.
As I was testing it, the program suddenly stopped giving an output. Here is the code:
#include <iostream> using namespace std;
int main() { cout << "Ten people ate breakfast with you this morning. Each of them " << "had pancakes. Please enter how many pancakes each of the ten people " << "ate. " << endl;
[Code] ...
The while loop after int glutton does not work and seems to stop the program. I replaced the "glutton" in the cout with "testing testing" and it still did not work. However, when I commented out the loop, it appeared. Finally, it can't be what's inside the loop, because I commented that out too, and it still didn't work.
the program is of an address book. the syntax is all fine, and the initial menu of options does show up. but once you punch in the cin, the program just stops.
I am currently working on a c++ project that will input students and process their grades. I encountered a problem and my code stops executing after the getScores function. Im not sure what the problem is, but im guessing its something within the function and the loops.
//Name: getScores //Description: Will get scores for student //Parameters: None //Return: testScore double getScores()
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.IO.Ports;
[Code] ....
How to pick date / time when serial port starts reading , and also when reading stops ?
What I want to do is create a file that will ask the user to enter his info,n then store it in a text file The screen will ask the user if he wants to update his info. if he says yes then the screen will be cleared and the old info will be printed on the screen. The user will enter his new info that will be stored in a new file. My problem is that once the user finishes entering his input the program just closes D: and the rest of the program won't run.
Code:
int main() { string ans; ofstream Xfile("original.txt"); cout <<"Enter your name and address please"<<endl; cout<<"Press Ctrl+Z+Enter when you are done"<<endl; string name_and_street;
Actually the below program is for Dispersal Algorithm called Rabin-IDA; this algorithm divided the data into N pieces and then recombine it from M pieces (such that M<N).
Thus, the below program needs command line arguments,which entering by Project properties/Debugging. this argument is file name, where the program performing spitted the file into N files, and then recombine it from M divided files, and put it on another file which should also passing its name as argument .
Now my question is, How can i make this program enter the file name by keyboard??(i mean enter the files name by user from screen not as command line arguments) ... In another word, How I can exchange ?
Code: argc == 3 and Code: argc == 2
To enter file name ? i mean what i should do to in
Code: rabin.split(argv[1])
To pass my file name by use keyboard not Project properties/Debugging?)
the below code is just the main function of program, and the whole of it in this link [URL] .... Information Dispersal Algorithms Rabin-IDA.
I need to append file path for some particular program. But the problem is when I append it like below, it gets error whether filepath seems to be C:/Users/My/Desktop/C++/1.txt
int i=1; stringstream str; str<<"C:/Users/My/Desktop/C++/"<<i<<".txt"; string filepath=str.str(); cout<<filepath; ifstream ipf(filepath); if(ipf) { do some thing...}
But if it was like this no error, program work as desired.
int i=1; stringstream str; str<<"C:/Users/My/Desktop/C++/"<<i<<".txt"; string filepath=str.str(); cout<<filepath; ifstream ipf("C:/Users/My/Desktop/C++/1.txt"); if(ipf) { do some thing...}
I would like to modify attributes like modification/creation dates.The function is correctly working as if I type in "ls -al", the timestamp is correct. But when using my program to read these attributes, it returns the "real" modification/creation date. Here is the function that shows the timestamp :
Code:
time_t t = sb.st_mtime; struct tm tm = *localtime (&t); char s[32]; strftime (s, sizeof s, "%d/%m/%Y %H:%M:%S", &tm); printf ("%-14s %s", lecture->d_name, s); And here is the code for modifying the timestamps : Code: void modifyAttributes(char * file, int mtime, int atime) }
I am trying to take text from a file and have it displayed using fprintf at line 46. When I run the below code nothing prints out. My text file has 4 lines with 5 different strings separated by whitespace.
#include <cstdlib> #include <vector> #include <cstring> #include <stdlib.h> #include <errno.h> #include <stdio.h> using namespace std; //declare my own struct