19,876 Topics

Member Avatar for
Member Avatar for aianne

Hi! I need help to my Turbo C program.. I need to create a program that will ask the "Starting X:", "Starting Y:", Ending X:", and Ending Y:" on different shapes.. this is how the program should be: [CODE]SQUARE: starting X: starting Y: ending X: ending Y: CIRCLE: Starting X: …

Member Avatar for WaltP
0
152
Member Avatar for lionaneesh

[CODE]#include<stdio.h> #include<string.h> int main() { int i,x; char c[100]; printf("Enter input :"); fgets(c,100,stdin); for( i = 0 ; i <= (x = (strlen(c))) ; i++) { if( c[i] = '\t') { c[i] = (' '); printf(" "); } printf("%c",c[i]); } }[/CODE] the aim of this program is that it will …

Member Avatar for Luckychap
0
142
Member Avatar for tquiva

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?

Member Avatar for hkdani
0
167
Member Avatar for urbangeek

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 …

Member Avatar for urbangeek
1
557
Member Avatar for guest7

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 …

Member Avatar for nezachem
0
466
Member Avatar for sushilmunot

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 …

Member Avatar for jephthah
0
93
Member Avatar for Iqbal_h_a

[code] Can anybody please tell me how to calculate/find total remaining(unused/free) memory in the system(using any functions)? Thanks Iqbal [/code]

Member Avatar for wsgeek
-1
454
Member Avatar for lionaneesh

[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 …

Member Avatar for jonsca
0
73
Member Avatar for dran08

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 …

Member Avatar for dran08
0
185
Member Avatar for lionaneesh

[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 …

Member Avatar for jonsca
0
82
Member Avatar for smi ensi

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 …

Member Avatar for jephthah
0
111
Member Avatar for paragj

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?????

Member Avatar for Aia
0
106
Member Avatar for philipghu

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 …

Member Avatar for jephthah
0
346
Member Avatar for Zephraph

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 …

Member Avatar for jephthah
0
79
Member Avatar for ShortYute

[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 …

Member Avatar for Adak
0
113
Member Avatar for lionaneesh

[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!!!!!!!!

Member Avatar for jephthah
-1
209
Member Avatar for lionaneesh

[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 …

Member Avatar for jephthah
-1
99
Member Avatar for tonyrockcakes

hello i'm using C++ for the first time on my course after a year of c#. We are suppose to make a client and server using pre existing code. One file was server one was of a client. There must be 3 classes a common class/ base class and a …

Member Avatar for tonyrockcakes
0
231
Member Avatar for tquiva

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 …

Member Avatar for Aia
0
154
Member Avatar for sharpcon

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 …

Member Avatar for Aia
0
111
Member Avatar for Xufyan

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, …

Member Avatar for Xufyan
0
167
Member Avatar for Xufyan

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 ?

Member Avatar for Xufyan
0
211
Member Avatar for hondros

Okay, as the name implies, I would like to change an integer (ascii code number), such as 65, to a string, '65', then back to integer, 65. Now, the reason for doing so, is because I'm working with ascii code, and want to return a string of a fixed length. …

Member Avatar for venkat arun
0
411
Member Avatar for gabz16

Hi Programmers, Please help me in my project constructing a Phonebook program in c using linked lists with add,search,view and delete function.

Member Avatar for gabz16
0
2K
Member Avatar for tquiva

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 …

Member Avatar for WaltP
0
122
Member Avatar for lionaneesh

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 …

Member Avatar for Aia
0
181
Member Avatar for mastermosley

My datagrid column, ID, Name, Member Number and there are about 50 entries into it. It reads an xml database and adds rows at runtime. When i click on the row to sort you can see the arrow up or down, and most of them sort but there will be …

Member Avatar for JerryShaw
0
109
Member Avatar for shetnok13

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() …

Member Avatar for Aia
0
179
Member Avatar for leverin4

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 …

Member Avatar for nezachem
0
399
Member Avatar for sandyjain

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 …

Member Avatar for Banfa
0
161
Member Avatar for xavier666

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 …

Member Avatar for Banfa
0
653
Member Avatar for churni

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 …

Member Avatar for churni
0
101
Member Avatar for Freespider

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 …

Member Avatar for abhimanipal
0
98
Member Avatar for Mz3g

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. …

Member Avatar for abhimanipal
0
216
Member Avatar for nats01282

I have been told that C++ and C# are very simular, as i am learning C++ and ust downloading XNA which use's C# I just wanted to know if C++ and C# are similar (exept the fact they both begin with the letter C )

Member Avatar for venkat arun
0
161
Member Avatar for balthy

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. …

Member Avatar for jephthah
0
2K
Member Avatar for loverdoll

hi? i'm in need of help.. our instructor in computer programming asked us to make a program..mine is a program that will ask the user to input how many sides of polygon she/he wants..minimum of 3 and maximum of 10..and the output should be the polygon with the user's inputted …

Member Avatar for loverdoll
0
102
Member Avatar for ChrisXxX

OK, here's my sample code. The problem is indicated with [PROBLEM] at the starting of the code line. I'm getting a compilation error saying that: 706 C:\Users\user\Desktop\Project.cpp `reg_num' has not been declared 706 C:\Users\user\Desktop\Project.cpp request for member of non-aggregate type before ',' token and its saying this for all my …

Member Avatar for WaltP
0
109
Member Avatar for revenge2

hello there, I am working on a small c program that automatically detects whether the input given is a decimal number or a binary number and coverts accordingly. what is the best way to convert a binary number to a decimal number and a decimal number to a binary number. …

Member Avatar for akirue09
0
529
Member Avatar for matika

[FONT=Lucida Console][COLOR=Blue]is there any function that helps to sort an array of strings alphabeticly i need to sort an array alphabeticly which contains names of students thx 4 yr help matika :cool: [/COLOR][/FONT]

Member Avatar for sachin_mnnit
1
760
Member Avatar for zendet

Hey guys, i need some help with a hangman project for school. The outline is: make program that plays the game of hangman, read the word to be guessed into a string variable. ( The programmer must make about 10-20 words to have one randomly picked each time a game …

Member Avatar for WaltP
0
456
Member Avatar for sam_021

Hi basically i dont have time to do this coursework , due to overload of work .. it probably take like an hour for some1 who knows what they are doing .. ill pay like 15-20 quid ?

Member Avatar for Aia
-3
33
Member Avatar for Freespider

hello... i want to separate string like "!string" i need to put the "string" to some char*... i did char firstWord[10]; sscanf(text,"!%s",firstWord); why its not woking? and how to make it work? i try to search, but nada....

Member Avatar for WaltP
0
132
Member Avatar for elie_kfoury

Hey.. i want to make a string from a text file.. then i want to compare this string with another to see if they are the same... any help?? /*I'm a beginner*/

Member Avatar for elie_kfoury
0
96
Member Avatar for omar isaid

fscanf is a C function designed to read character by character from a file to the system how we can use scanf programmatically to read till first white space ???? :) :)

Member Avatar for omar isaid
1
3K
Member Avatar for aliase

Hi, The problem I'm having is killing a process without knowing it process ID. What I have right now is a client-server communication using FIFOs, the server is running in the background and the client is running in the foreground. What I want to do is when the client quit, …

Member Avatar for Salem
0
94
Member Avatar for abhishekvarmag

Calendar Program [code]#include<conio.h> int day(int m1,int y1) { int d; if(m1==1 || m1==3 || m1==5 || m1==7 || m1==8 || m1==10 || m1==12) d=31; else if(m1==4 || m1==6 || m1==9 || m1==11) d=30; else if((y1%100!=0 && y1%4==0) || y1%400==0) d=29; else d=28; return d; } void main() { long unsigned …

Member Avatar for Aia
-3
792
Member Avatar for anik biswas

hi, I cannot figure out the programme code for the following problem: Write aq programe code for printing all the combinations of the numbers 1,2&3. I would be gratefull if you can help me out with this. Thank you.

Member Avatar for Adak
0
89
Member Avatar for TimCereja

This has been working fine on my system, but refuses to compile on a server that I've uploaded it to. printf("Press <ENTER> to Continue\n\n"); while(getch() != 0x0d); The error message that I get is: undefined reference to 'getch' Any idea how to define getch and get this to compile?

Member Avatar for Ancient Dragon
0
93
Member Avatar for lionaneesh

Hello everyone, Firstly i'll like to introduce myself to the forum. HEy... Ya my need is tat i need a super simple ebook(FREE) on C programming and covering advanced aspects of C like C - linked list , c-graphics and C-BITS... help! /************************************************** **************************************************/

Member Avatar for lionaneesh
-1
109

The End.