c++ string prob


 
Thread Tools Search this Thread
Top Forums Programming c++ string prob
# 1  
Old 08-14-2009
c++ string prob

hi could some body help me?
im making a program that writes in a file.txt
how can i compare my "char x" to another char?

Code:
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;

int main()
{

char x[100]; 
char y[100];





cout << "enter title" << endl;
gets(y);
ofstream rave(y, ios::out);

cout << "enter word" << endl;
do
{
gets(x);
if (x!= (?))  // <= i need something that "char x" could be compare to so //that my  if comd will execute
{
rave << x;
}

}while(x != (?)); // <= same above

rave.close();

}


Last edited by Franklin52; 08-15-2009 at 08:11 AM.. Reason: cleanup urls and adding code tags and approve post
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Prob. with using as86

Hi, I have downloaded as86-0.16.17.tar file. When I umcompressed it I found it consisting of C source and header files. How can i create an executable for compiling assembly programs. Kindly help me with this. I am working on windows XP professional and system is HP DX 2700. Zulfi. (0 Replies)
Discussion started by: zak100
0 Replies

2. Solaris

Solaris 8 prob

Pls tell me how can i recover adeleted user in solaris 8. Please help me I'm a newby thanks aamer (4 Replies)
Discussion started by: aamer
4 Replies

3. Solaris

mount prob

# mount /dev/dsk/c1d1s1 /mnt mount: /dev/dsk/c1d1s1 is not this fstype I tried to mount the above raw patition and it gave an error. but can someone help (3 Replies)
Discussion started by: seyiisq
3 Replies

4. Shell Programming and Scripting

sorting prob

my sample is 01012007 01022007 02022007 01032007 20022007 02032007 01092007 05022007 30022007 which is date in ddmmccyy format i try to sort like this sort -n +0.2 -0.5 +0.0 -0.3 file but the results are not correct pls help...... (3 Replies)
Discussion started by: paresh n doshi
3 Replies

5. UNIX for Advanced & Expert Users

NFS prob

Hi all, i want mount directory with permission #NFS Server = FreeBSD /etc/export = /data -alldirs -network 192.168.0.0 -mask 255.255.255.0 #NFS Client = Ubuntu 192.168.0.8:/data /dir nfs intr but i m unable to create folder in /dir whts the wrong? Please... (4 Replies)
Discussion started by: jagnikam
4 Replies

6. UNIX for Dummies Questions & Answers

prob's with while loop

Hi Gurus, I have a requirement where I have files in a folder For example in home/input i have files 20080111.06.12.45_abc.xml 20080112.06.10.48_abc1.xml 20080113.06.08.55_abc2.xml 20080114.06.12.35_abc3.xml Actually i will get the files as abc.xml , i rename & put it with timestamp.... (2 Replies)
Discussion started by: pssandeep
2 Replies

7. Shell Programming and Scripting

prob with ssh

I am executing this on say host1 export dn=/home/abhi export fn=file\"*\" file_path=$dn/$fn set -A files $(ssh host2 "eval echo $file_path") echo files= ${files} So the purpose is to store in array "files" .. the o/p of cmd executed in host2... this script works fine if the files r... (1 Reply)
Discussion started by: abzi
1 Replies

8. UNIX for Dummies Questions & Answers

cronjob prob

Hi all I am getting the following error when i execute my cronjob : stty: : No such device or address stty: : No such device or address What could be the problem. Thanks Rahul (3 Replies)
Discussion started by: rahul123_libra
3 Replies

9. UNIX for Dummies Questions & Answers

grep prob

hi, how can i saerch for foll pattern the line contains many entries: xxx xxxx ddd ffff gggg 30% rr eeee eeee rrrr rrrr 100% rr eeee eeee rrrr rrrr 43% how can i display lines having size greater than 40%?what pattern shud i use in grep? thanks! regards vivek.s (1 Reply)
Discussion started by: vivekshankar
1 Replies

10. Shell Programming and Scripting

prob

When i am trying to $uncompress tress.dmp.Z I am getting tress.dmp.Z permission denied. What action i have to perform to unzip or uncompress It has rw-r--r-- permissions When i am trying to change the permissions chmod 744 it says. chmod: Warning: can't change tress.dmp.Z Just... (1 Reply)
Discussion started by: dreams5617
1 Replies
Login or Register to Ask a Question
ttk_image(n)							 Tk Themed Widget						      ttk_image(n)

__________________________________________________________________________________________________________________________________________________

NAME
ttk_image - Define an element based on an image SYNOPSIS
ttk::style element create name image imageSpec ?options? _________________________________________________________________ DESCRIPTION
The image element factory creates a new element in the current theme whose visual appearance is determined by Tk images. imageSpec is a list of one or more elements. The first element is the default image name. The rest of the list is a sequence of statespec / value pairs specifying other images to use when the element is in a particular state or combination of states. OPTIONS
Valid options are: -border padding padding is a list of up to four integers, specifying the left, top, right, and bottom borders, respectively. See IMAGE STRETCHING, below. -height height Specifies a minimum height for the element. If less than zero, the base image's height is used as a default. -padding padding Specifies the element's interior padding. Defaults to -border if not specified. -sticky spec Specifies how the image is placed within the final parcel. spec contains zero or more characters "n", "s", "w", or "e". -width width Specifies a minimum width for the element. If less than zero, the base image's width is used as a default. IMAGE STRETCHING
If the element's allocated parcel is larger than the image, the image will be placed in the parcel based on the -sticky option. If the image needs to stretch horizontally (i.e., -sticky ew) or vertically (-sticky ns), subregions of the image are replicated to fill the par- cel based on the -border option. The -border divides the image into 9 regions: four fixed corners, top and left edges (which may be tiled horizontally), left and right edges (which may be tiled vertically), and the central area (which may be tiled in both directions). EXAMPLE
set img1 [image create photo -file button.png] set img2 [image create photo -file button-pressed.png] set img3 [image create photo -file button-active.png] style element create Button.button image [list $img1 pressed $img2 active $img3] -border {2 4} -sticky we SEE ALSO
ttk::intro(n), ttk::style(n), ttk_vsapi(n), image(n), photo(n) KEYWORDS
style, theme, appearance, pixmap theme, image Tk 8.5 ttk_image(n)