This program is meant to present users with a list of rooms they then press the 'Select' button and it starts the relevant program for that room. However when running the program on Windows 8 it is giving an error that 'The requested operation requires elevation.'
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
[code]....
P.s. It runs the programs as local administrator so that the user does not get prompted for UAC permission, as this is something the users find very annoying!
So basically here I have a menu in my C program and if I were to select option 2, I would enter a string up to 30 characters and it would output each block of 16 bytes should be shown which contains a character in the requested string. However, when I compile and run the program and search for the string, nothing happens. what I may be doing wrong?
Code:
else if (select == 2){ printf("Enter a string of up to 30 characters: "); scanf("%s", &userstr); //Compares both user's string and file string for (i = 0; i < size; i++){ if (strcmp (buffer, userstr) !=0){
I would like to create a C program which requires the input in this form: number1 operator number2, where number1 and number2 are numbers of type double and operator is one of the characters +,-,*,/.
There is my attempt to write this code:
Code:
#include <stdio.h> double main() { char operator;
[Code]....
Now I have to solve these problems: This code above doesn't work and I don't know why.I don't know how to fix the case when some user enters the input in this form:
Code: 1.5896 *5 or Code: 7 / 5
I mean how the program knows that
Code: 1.5896 *5 is the same as Code: 1.5896*5
I don't know how to fix the case when the user enters the input in the incorrect form for example
writing a program that requires exception handling. if an error occurs, i what the program to go back to the begging of the loop. i tried using break but that just makes the program crash when it receives a bad input. how do i do this? this is what i have so far (this part of the program any ways)
while (! quit) { // Output phone book menu cout << endl
Error1error C2955: 'DoubleLinkedListInterface' : use of class template requires template argument listdoublelinkedlist.h10 Error2error C2244: 'DoubleLinkedList<T>::DoubleLinkedList' : unable to match function definition to an existing declaration doublelinkedlist.cpp7
Error3 .cpperror C2244: 'DoubleLinkedList<T>::~DoubleLinkedList' : unable to match function definition to an existing declaration 12
.h
#pragma once #include "DoubleLinkedListInterface.h" #include "Node.h" #include <iostream>
I am just trying to get a code going for a mock test and to get use to the getline and IF operations, but it seems I have ran into an issue[URL] is a link to the code I have written, and I can use getline to give a value to my variable, but it seems like it gets lost once I try to use the IF function. Am I not using the right variable type?
I need to run some operation if a key from keyboard is pressed. so I go with
Code: c=getchar();
to get it read. yet the user could press a key anytime; so I'd need some if-loop. no plans on how it'd look like though...I suppose something like this below wouldn't work right?
How do I do the operation of two integers that gives you the results?
I'm supposed to write a program that:
Asks the user for an integer Asks the user for one of '+', '-', '*', or '/' (as a character) Asks the user for another integer Performs the given operation on the two integers, and prints out the result of
Please enter an integer: 4 Please enter an operation (+, - , *, /): * Please enter another integer: 5
4 * 5 = 20
Code: #include <iostream> using namespace std; int main() { int x; int c; int d; char e;
union { short *two_int; int *four_int; double *eight_real; char *one_ascii; // void *v; };
We have write function which write into file.
fwrite (r.one_ascii, 1, i, outstr);
I found one thing,When we write function, we fill only four int in following way.
r.four_int[0] = x + xoff; r.four_int[1] = y + yoff;
So my question,we fill four_int but write one_ascii only.As is it union of pointer. So it does not matter. I am using 64bit machine and do not have any issue in 32 bit machine.
So I am making a game and I want to push performance to the limit. That's why I really want to know how many clock cycles every operation, cast, memory allocation - EVERYTHING takes. Or approximate time consumption ratio, anything like that.
I tried doing it myself: I created a timer based on clock cycle counting, measured time of an empty loop and the same loop with various operations inside, but the results were extremely inconsistent and confusing: empty loop would take more time that the same loop with an addition, the time would vary greatly,... I guess it's because of background operations using up some of the CPU...
Since I didn't manage to find anything on the internet I guess there might be something I'm missing: maybe it depends on the processor?
I have to build a program that calculates the remainder of the expression
(2^10)!/((2^10-500)! * 500!)
when divided by 10^9+7
where x^y = x*x*x*x...*x (y times) and x! = x*(x-1)...*1
How can I do that? I know how to calculate the remainder of x! and the remainder of y!, but I do not know how t calculate the remainder of x!/y!. I can´t even store this in a variable because x! is very large.
I had created windows service .from that i just want to insert data into database . It is successfully installed but it is not started. It gives an error service could not started...
I am having some column say "Response" column in my Datatable.Now I want to fetch this particular column value and compare this value with the maximum response how to fetch and compare it in C#.net .. This is my code.
for (int i = 0; i < DataFilter.Rows.Count; i++) { DataRow dr = DataFilter.Rows[i]; DataView dv2 = new DataView(); dv2 = DataFilter.DefaultView;
I have a VC++ 6 dialog-based application. This application is intended for reading data from a USB device (this is a FTDI FT245R chip). I have a start button on the dialog. On clicking it, unsigned char data retrieved from the USB device is displayed on the dialog. The start button invokes a function which includes a while (1) loop inside which the USB device is read and the values displayed.
There are no break or continue statements inside the always operating while (1) loop. All this works fine. My problem is how do I exit the application as normally it would just run forever? I have put an exit button on the dialog with code added to call OnOK(). Normally this would nicely close the application but as I have an endless while loop in my application so this button doesn't seem to work. Nothing happens on clicking it and clicking it repeatedly just hangs the program.
error C2995: 'foo<l+r> operator *(const foo<s> &,const foo<r> &)' : function template has already been defined see declaration of 'operator *' see reference to class template instantiation 'foo<s>' being compiled with [ s=4 ]
If I change the operator to return a foo<s> it does compile (but that's not the behaviour I need).
if I move the operator to outside the class (removing the 'friend') it does compile and behaves how I need, but I can't access non-public members so I can't write the implementation correctly.
A process is writing data continuously to a file . I need to stop the write operation if the file size has reached 1GB. Is there any way to check file size when it is opened for the write operation.
I could do the same using scripts. Can this be done using C Programming ?
I trying to write a code for a calculator using stack is how to convert an operation from infix to postfix . Here is my attempt I created a header file.
#ifndef STACK_H #define STACK_H #include <iostream> using namespace std; template<class T> struct node { T item;
So the thing is I have 2 forms, form 1 is displayed first, and form2 would be open when click the next button on form1.
So i was success in moving to the next form, and even getting back to the previous, and then next again, but on the second time I try to go back from form2 to form 1, this error show up.
The error:
Form that is already displayed modally cannot be displayed as a modal dialog box. Close the form before calling showDialog.
In 83rd line message says: "Illegal Structure operation". But I didn't use any structures! How to correct it?
#include<iostream.h> #include<conio.h> #include<math.h> int prime(int); int reverse(int) ; int power(int,int); int rectangle(int,int); int square(int); int circle(int); void tables(int);