15,552 Topics
| |
I know I would first declare the input variable as char. But that just reads in the first letter of the word. How can I print or read each letter of a certain word? | |
hello guys...i'm rookie in C...just starting out...:$ Well...the program i was trying to write was make a series like: 0 10 010 1010 . . . Now i wrote a program. But it's kinda behaving weird. Let me show your the output: [ICODE]enter the no of rows you want: 4 … | |
Hi, I am trying to compile an open source code on linux Ubuntu and getting the following error: conflicting types for ‘strlen’ I am pasting the program in which it is giving me the error : [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include "port.h" /* * strstr - find first … | |
hello i am trying to do matrix multiplication on a 2D array using pitch. i am able to load the 2D array on gpu using cudaMallocPitch() and cudaMemcpy2D() function, but i am not able to write the multiplication code. The output which i am getting is wrong. Can anyone help … | |
[code] Can anybody please tell me how to calculate/find total remaining(unused/free) memory in the system(using any functions)? Thanks Iqbal [/code] | |
[CODE]#include<stdio.h> #include<string.h> int main() { int i; char line[100]; char line2[100]; printf("Enter some lines : "); scanf("%[^\n]",line); printf("2:"); scanf("%[^\n]",line2); if((i = strlen(line)) >= 80) { printf("%s",line); } if(strlen(line2) >= 80) { printf("%s",line2); } getchar(); return(0); }[/CODE] the main aim of making this program is that it will input 2 lines … | |
Good day, I am a freshmen student in need of some help. I have created an ATM program. This program has text files created for the withdraw transaction, deposit etc. It is like a database program for me. First of all, I would like to know how to compare strings … | |
[CODE]#include<stdio.h> #include<string.h> void reverse(char str[]); int main() { char str[100]; int i; printf("Enter to reverse : "); scanf("%[^\n]",str); reverse(str); return(0); } /* Function */ void reverse(char str[]) { int i; for(i=(strlen(str));i > 0; i--) { printf("%c",str[i]); } putchar('\n'); } [/CODE] in this programme when we input 123 output = 32 … | |
hi; I find probleme is that the result of run not be saved in the file ; the second things that I m very sad because I work for 2 weeks and I can't up to now to do the programme; the programme is; we have class called A in … | |
I want to use input redirection to get directory name instead of a file. for eg: program < directory_name; so that it reads all me files in the directory. I am stuck with this in C.. Can anybody please help????? | |
| Hi all, I'm new to system programming. I wanted to read from a file into a buffer (say, buf[BUFSIZ]), from the end to the beginning. For example, if the file contains "Hello", then the buffer will contain "olleH". I know lseek() will reposition the opened file offset. I just tried … |
I'm a beginner in the code world, taking my first programming class this semester. I got bored over spring break and wrote a program to send to some friends just for the fun of it, but I'm having a problem. I want to isolate any character entered that is not … | |
[I]I i've looked for a shell scripted forum but it's based on .nix so it doesn't apply to me [/I]. I'm making a program that will attempt to lessen the effects of a flash drive when placed in an infected pc. Basically it will make a folder named autorun.inf then … | |
[CODE]#include<stdio.h> void reverse(char str[]); int main() { char str[100]; int i; printf("Enter to reverse : "); scanf("%s",str); reverse(str); return(0); } /* Function */ void reverse(char str[]) { int i; for(i=99;i>=0;i--) { printf("%c",str[i]); } putchar('\n'); }[/CODE] Why there is a runtime error in the above programme.......... help!!!!!! URJENT!!!!!!!! | |
[CODE]#include<stdio.h> #define LEGAL 1 void count(char array[]); int main() { char line[100]; printf("Hey user enter some lines : "); scanf("%s",line); count(line); return(0); } /* FUNCTION count */ void count(char array[]) { char c; int x,z=0; /* Wat to do to count \n and \t and blanks */ for(x = 0 … | |
I'm currently trying to edit this program so that it would read 4 inputs on the first line of data, instead of one. All other lines contains just 1 input. I created a program to assign a letter grade to an integer score. This was my first data file: [CODE]95 … | |
In the code snippet: [CODE=C] int Z; boolean ParsedOk; ParsedOk = sscanf( CommandLine, "%i", &Z ) == 1; [/CODE] I find that a successful parse occurs for both valid numbers, but also for numbers that have trailing rubbish, such as '3Q', etc. How can I detect (and reject) such malformed … | |
I want to calculate remainder of all the values inside nested loop with all the numbers inside the loop. for example when [icode] a=1 , b=1, c=remainder a=2, b=1, c=remainder a=3, b=1, c=remainder a=1, b=2, c=remainder a=2, b=2, c=remainder a=3, b=2, c=remainder a=1, b=3, c=remainder a=2, b=3, c=remainder a=3, b=3, … | |
alphabet from lower to upper , using ascii what logic should be use to convert small letters into capital using ascii codes?? for example ascci code for A is 65 and ascii code for a is 97 how can i coonvert from integers to character ? | |
Hi Programmers, Please help me in my project constructing a Phonebook program in c using linked lists with add,search,view and delete function. | |
I am trying to create a program to read a series of input characters representing grades (e.g., an 'a' or 'A' represents an A, a 'b' or 'B' represents a 'B', and so on) and prints the counts of each grade. [CODE]/* A program to count the number of grades … | |
Exercise 1-11. How would you test the word count program? What kinds of input are most likely to uncover bugs if there are any? Exercise 1-12. Write a program that prints its input one word per line. help me wid these questions temme the source code and the logic and … | |
I'm a First year IT student and I'm having a problem with my vending machine program.. I can't subtract the cost from the input of the user.. can anyone help me with this simple problem?.. [CODE]#include<stdio.h> #include<conio.h> struct vendingmachine { int x,y; float cost; double change; char nikz; }; main() … | |
I understand, vaguely, what a reduce/reduce conflict is, but I don't understand why I'm getting one in my Yacc Parser. Can anyone help me out? [code=yacc]Prog : START StmtSeq END { }; StmtSeq : Stmt StmtSeq { }; StmtSeq : { }; Stmt : Id ASSIGNOP Expr SEMICOLON { *$1 … | |
Hi, i am working on Numerical Computation with C.... i have a data file which has two columns separated by a tab in between... it looks like [code] 43.0000000000000 43.0000000000000 42.0000000000023 43.0000000000006 41.0000000000000 43.0000000000056 40.0000000000000 43.1999996948242 [/code] i have written this code which seems to work out smoothly... [code] #include … | |
Okay, this time, i have to say it's a weird error. This code runs fine in Code::Blocks 8.02 but fails to run in my college compiler. I think my college compiler is the GCC Compiler (same as my home compiler) but in LINUX environment. Something like [CODE]vi sort.c cc sort.c … | |
hi, i have some code which is taking a value of how many moves a function is making to an array of numbers, and displaying it but basically, when i call the function initially, it will give the correct number of moves, when i call it again its adding the … | |
heyy... i need to analyse diffrent text(strings) inputs... and there is no pattern between the inputs... i have a question in my school...i need to do like a little storage with char**...and each time i get a string i need to input it into the char**, if the char** gets … | |
Hi guys, I am doing a TCP/IP time server/client. I already wrote the two programs but when I run them I don't get any output. Simply, the idea is the client asks the server for Time or Date and the server has to respond and terminate after the second request. … | |
Hey guys, I'm new to programming and C, and I'm trying to write a program for a weighted dice, but I'm awful at math, and I can't figure out how to get it; it took my stupid self long enough to turn rand() into a number between 1 and 6. … |
The End.