im trying to write a program that prompts the user to enter three numbers and then prints them vertically (each on one line), first forward and then reversed. this is how the design should look:
enter three numbers: 1 43 54
your numbers fowards:
1 43 54
your numbers backwards:
54 43 1
this is what i have thus far when it comes to code....
#include <stdio> int main (void) { // local declarations int a; int b; int c
I am trying to write a c program to convert centimeters to inches and then to feet. I have most of the code written but not sure how to debug it. I keep getting "0" as all of my output.
#include <stdio.h> // Main Function int main(void)
I have turbo c++ on windows xp SP2.....whenever i compile my code in turbo c++ i am getting output outside the screen.....but when i used code::block....i get the correct output...fits to screen ...
I need to display 0-15 hex numbers[0X00-0x0F] in decimal value...& I'm getting the output but it's not exactly what it should be,below is my code.. [This not the complete code,but main part where the changes are done]
Actual output i should get is for 1v it should generate 0001,for 2v it should generate 0010 and simultaneously till [15v-1111]... But what i'm getting is exactly different to this for eg for 7v,8v&9v the bits generated are 1101,1011,1011 respectively...
I have been given an assignment to make a code to read some text nd display all the words nd the number of times they appear in another file or as output without displaying the repeating words. I made the code but its not giving any output.
#include <stdio.h> void Swap(int *x, int *y); int *Largest(int *array, int size); int main() { int a, b, i; int c[10]; int maxaddress; }
[code]...
My swap function works fine, but I am trying to find the ADDRESS of the largest element in my array and I am getting an error using gcc on my "return &largest;" and my printf line in my main function.How can I fix this and return the address of the largest?
So for class I have to make an array of structures for a basic contact list in a phone.
I understand the bones of the program and how to go about doing most of it but as far as arrays of structures go I am blind. Code:
struct phone { char FirstName[16]; char LastName[16]; int Number[11]; }; struct phone numbers[friends]; //friends is a variable assigned by the user What I am a bit confused about is say the user enters 30 as how many friends they have. How would I assign a value to the 3rd struct for LastName?
This is for a class project. I am having trouble "pulling out" the last element in my array, shifting all the elements back then inserting that last value in the front. Then also displaying the array after the shift. here's my code.
#include "stdafx.h" #include<iostream> using namespace std;
here is what it does;it reads from a text file and converts the characters to ascii numbers and stores them in 1D array.what I am trying to is storing these ascii codes in 2D array.
Read *.bmp image and displaying bitmap image with scrollbar in a MFC dialog application.
I was done using this
I was read the *.bmp image as a pixel data and stored by 2D Array,
Now i want to Display this 2D array as bitmap image with scrollbar separately in the same dialog. How can i display bitmap with scrollbar using 2D array?
I need to run some basic statistics on about ~150 tables that are currently in dBase format. Rather than use excel to do them all individually, i was told to use s+ and write a code to loop through them, but I have never written any code and my experience with spotfire s+ is limited (the stat software i have available) ....
I am having trouble with an assignment. The assignment consists of a basic encryption and decryption program already written for me, I just have to write the encryption function. What we have to get the program to do is enter an integer and a text, and get the program to increment each letter in the text by the integer given. I did this by using a for loop and incrementing each value in the string by the integer.
However, I still can't get it to decrypt and I need the program to work with only a-z letters (if I increment each letter by 3 and I have the letter Z, it should go to Z+3 = C).
I attached the description of the attachment and below are the codes: The first file does not need to be edited.
Code: /*******************Programming Assignment 1***************/ /****************Caesar's substitution cipher**************/ /*****************YOU MUST NOT EDIT THIS FILE**************/ /****Substitute alphabets in a string using rotation key***/ /****Leave all other characters unchanged******************/ /****Confirm correct encryption by decrypting**************/
I had to learn how to use variadic templates recently, and had trouble finding simple examples that just showed the basic syntax.
So I decided to write one myself. Admittedly, it's a bit on the long side, but that is mostly because it includes five specializations.
insert Code: // Variadic.C // Compile command: g++ Variadic.C -std=c++0x // I used GCC version 4.6.3 on Ubuntu.
// This file contains a basic variadic template with five specializations. // It is intended for non-software engineers who are looking for a simple // example of variadic template syntax.
So I am currently in the middle of learning c++ and I decided to jump ahead of the book and tried to do add procedures. My goal is to have main calling other procedures such as welcome message().
I want to configure netbeans 7.4 settings for c++.I'm posting here because netbeans forums are close to dead. How to do the following things :-
1) When you create a new project of a 'new application' type, main.cpp is already there with some code. I want that main.cpp to be completely empty when I create a new project.
2) When you compile/build your program and run it, the output is shown in a small log window at the bottom. I want it to be shown like in a black output terminal (console ?) just like in Visual Studio or CodeBlocks. (I have some reasons for not using them instead, so don't bother about me not using them)
3) When you click the green 'Run' icon in the upper toolbar, the project is compiled/build again and then runs afterwards. I want it to just run without compiling. (Compiling/Building should be done by 'Build' icon, just like in CodeBlocks or Visual Studio)
I have learned the basics you need to know about c++ so I was wondering, how do you make a GUI from scratch without using any programs like qt, daniweb, ect. Is there like a ongui() or something?
Let assume i have a gtk window with a drawing area and a button in it....
When the application is run it will show ball... when the button is pressed it will start bouncing from one side to other... When the button is pressed again it stop bouncing...
Also the window shows the current XY co-ordinates of the ball in the bottom left corner(inside the drawing area)...
I want to use C , GTK3 and CAIRO only...
I have googled and found animation example not with GTk3 but GTK's previous versions instead...those doesnt work with GTK3..i have also read cairo's official,zetecode's tutorails and some other sites..but nowhere found any solution to my problem...
I know how to do so with OpenGL and it's very easy...but i cannot apply the same logic with cairo and gtk3...please dont suggest to use GtkGlExt...i don't want to use it...