Sponsored Content
Top Forums Programming C Beginner Looking For Suggestions Post 302302648 by c_d on Tuesday 31st of March 2009 02:15:00 PM
Old 03-31-2009
hows this?
Code:
#include<stdio.h>
#define SP 32
#define BRK_LOP 16

int main()
{
    char ch;
    int flag=0;
    puts("Press ctrl+p to stop");
    while((ch=fgetc(stdin))!=BRK_LOP)
    {
        if(ch!=SP)
        {
            fputc(ch,stdout);
            flag=0;
        }
        else
        {
            if(flag==0)
               fputc(ch,stdout);
            flag=1;            
        } 

    }
    return 0;
}

Quote:
I'll also say that I have a lot of trouble thinking in parallel, but it seems that that is how the best coders think.
parallel in what sense?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Suggestions on where to begin?

I have been a student at Hendrix Institute for about a year now. My term is comming to an end by the end of december. I have learned varios computer programs for web development that include Flash 5 and Dreamweaver. Actionscripting, Javascript and Database development with Access was all... (4 Replies)
Discussion started by: andrew25008
4 Replies

2. UNIX for Dummies Questions & Answers

Suggestions wanted ...

All, Have an AMD-K6/2 PC, 20G.Hd along with RH7.2. Wanting to know what I should do in terms of setup (workstation/server) and then what I can do with it? I'd like to learn a DBMS and SQL - can I do this using RedHat? Any suggestions with how I can use/ what I can do with this appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

3. UNIX for Dummies Questions & Answers

Backup suggestions

The current backup procedure we using a tar command in linux. The files are stored in one partition in different folders. The docs stores in day wise folders like ex: /usr/data/xyz/20050129, /usr/data/xyz/20050130 .............etc We using tar & gzip command to take backup everyday. The backup... (3 Replies)
Discussion started by: bache_gowda
3 Replies

4. UNIX for Advanced & Expert Users

Looking for Suggestions...

We run WebSphere and by default it wants to install everything under /usr. While I can understand the default (everyone has a /usr) I would like to move this over to a dedicated volume group called apps and then setup my lv's and fs's here. Our WebSphere Admin doesn't like this because apparently... (1 Reply)
Discussion started by: scottsl
1 Replies

5. Solaris

Suggestions Req

Hi all, I have worked on HP UNIX and now i have moved to SunSolaris which i never used to work. I am more on programming side like shell and perl scripting. So i want to know from you experts that i need to take care or changes which i code in sun solaris in compared to HP unix. Suggestions... (1 Reply)
Discussion started by: ravi.sadani19
1 Replies

6. Shell Programming and Scripting

Suggestions on input

Hi, I have written a script which calls a process which ends up in a reboot of the system. At the end of the reboot it prompts for login & i need to provide the login details. am not able to figure out hw to do this. Doubt: will echoing login details after calling the process work? for ex:... (1 Reply)
Discussion started by: meera
1 Replies

7. UNIX for Advanced & Expert Users

Need suggestions.......

Hello there....i am a final year comp science student.......i am thinking of doing my project on unix platform......which one do u suggest?thanx in advance... (3 Replies)
Discussion started by: theprasad1990
3 Replies

8. Solaris

Suggestions for new T5140

I've been busy and fell behind on Sun/Oracle. Forgive me if too basic. I welcome brief, cryptic, or advanced replies. I also welcome noobie information since I may have no clue what's up at the moment. Problem statement: I inherited a computer to set up. I would rather not figure out 8 months... (1 Reply)
Discussion started by: Nevyn
1 Replies

9. UNIX for Dummies Questions & Answers

Suggestions for the interview

Hi guys, i'm undergoing a traning in solaris administration and i request if any one have an idea on the interview questions on solaris. thank you. (3 Replies)
Discussion started by: 038karthik
3 Replies

10. Shell Programming and Scripting

Suggestions on this script please

i=1 out="" j=`expr 2 * $1` while do out="$out"#"" echo $out ((i=i+1)) done while do print ${out%?} ((i=i+1)) done This script is throwing an error: gurnish:/home/fnb/gurnish/saurabh/scripts> while1 3 expr: 0402-050 Syntax error. # (6 Replies)
Discussion started by: targetshell
6 Replies
PUTS(3) 						     Linux Programmer's Manual							   PUTS(3)

NAME
fputc, fputs, putc, putchar, puts - output of characters and strings SYNOPSIS
#include <stdio.h> int fputc(int c, FILE *stream); int fputs(const char *s, FILE *stream); int putc(int c, FILE *stream); int putchar(int c); int puts(const char *s); DESCRIPTION
fputc() writes the character c, cast to an unsigned char, to stream. fputs() writes the string s to stream, without its trailing ''. putc() is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once. putchar(c); is equivalent to putc(c,stdout). puts() writes the string s and a trailing newline to stdout. Calls to the functions described here can be mixed with each other and with calls to other output functions from the stdio library for the same output stream. For nonlocking counterparts, see unlocked_stdio(3). RETURN VALUE
fputc(), putc() and putchar() return the character written as an unsigned char cast to an int or EOF on error. puts() and fputs() return a nonnegative number on success, or EOF on error. CONFORMING TO
C89, C99. BUGS
It is not advisable to mix calls to output functions from the stdio library with low-level calls to write(2) for the file descriptor asso- ciated with the same output stream; the results will be undefined and very probably not what you want. SEE ALSO
write(2), ferror(3), fopen(3), fputwc(3), fputws(3), fseek(3), fwrite(3), gets(3), putwchar(3), scanf(3), unlocked_stdio(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
1993-04-04 PUTS(3)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy