Wednesday, May 15, 2013

how to attach c++ aplication to the website?

Q. i have aplication, which i made in c++ and now want to atach to web site which ill make in php. can any1 help and give tips how to make it?

A. Well, assuming it's a command line program, you can just call it as a CGI program. Setting up CGI access is different in Linux/Apache than it is in Windows/IIS.

Need help with a Unix program?
Q. I need help in writing a unix program for a homework assignment. All I have is this:

#!/bin/Bash
echo "Enter the two numbers to be added:"
read n1
read n2
answer=$(($n1+$n2))
echo $answer

I tried it out and it didn't work as planned. Can I get a little help as to what I'm doing wrong?
The actual assignment is below:

Write a bash program to implement an interactive adding machine. The program
should input 2 or more integers from Standard Input (keyboard) and output the
sum of those integers to Standard Output (display). It is not necessary to
check for invalid (non-integer) inputs. The program should terminate due to
user input.


Be sure your program includes all of the following:comments with your name, the date, and the assignment
comments or output with instructions for using the program
prompts for all inputs
labels for all outputs
descriptive names and/or comments explaining variables & functions
indentation of code blocks
comments explaining any non-obvious control flow

A. If you're going to be working in IT the very first thing you need to learn is how to explain a problem accurately and completely.

- What happened (or didn't happen) for you to say, "it didn't work as planned"?
- How did you try it out? (*Exactly* what commands did you type? What, if anything, did the system say in response to those commands?)

Now, from a superficial review of the code, the first problem is on the first line. You should have received an error such as this:
$ /tmp/homework
bash: /tmp/homework: /bin/Bash: bad interpreter: No such file or directory
$

This is a hint that the system cannot find "/bin/Bash", and indeed if you review that carefully you'll find that you should have typed "/bin/bash". Unix (and Linux-based) systems are case-sensitive.

Other than that, the problem fundamentally does what you need. You'll have to add all the fancy bits, though, such as comments.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

No comments:

Post a Comment