18,491 Topics

Member Avatar for
Member Avatar for jephthah

so... for 5 solid years, our C/C++ Warrior [URL="http://www.daniweb.com/forums/member17893.html"]Narue[/URL] has been a regular poster averaging 4 posts per day (4.08 to be exact). On June 21 2009, Narue disappears off the face of the Daniweb planet. new guy [URL="http://www.daniweb.com/forums/member552021.html"]Tom Gunn[/URL] had joined Daniweb five days previously, on June 18. Tom …

Member Avatar for jephthah
3
706
Member Avatar for smi ensi

I should do programme in C , but I don 't know witch struct I can use.:( question : we have congresse , where there is 2 type of activities : activity 1 and activity 2 in each one there is many activities where many people are linked in :( …

Member Avatar for Ancient Dragon
0
149
Member Avatar for Talguy

I have created a icmp ping function but it doesn't always work due to the firewall of the computer I am trying to ping. I heard you can get around this using a tcp ping. How can i construct a tcp ping packet. I did a little research and it …

Member Avatar for Talguy
0
160
Member Avatar for MTW1989

[CODE]include <cstdlib> #include <iostream> #include <iomanip> #include <stdlib.h> using namespace std; void printintromessage (); void getUserInput (char& Y); void printplayerinfo (const int& numofgamesinseries, const int& numofplayersonteam, int& i, int& j); int main(int argc, char *argv[]) { const int numofgamesinseries = 3; const int numofplayersonteam = 4; int i,j, score[numofgamesinseries][numofplayerson… char …

Member Avatar for MTW1989
0
206
Member Avatar for lionaneesh

[CODE] scanf("%[^\n]",line); [/CODE] tell me the logic of this scanf statement and why " [^\n] " is used instead of %s ... and how this statement works... i know that this statement inputs lines till enter is pressed.. but what is the format of the scanf statements please tell..

Member Avatar for jephthah
1
360
Member Avatar for unbrknchane

Hey Guys, So I am working on a program in class that asks for the age of your dog and translates it into human years....needless to say overly easy and boring. So I want to get into adding sprites to C. My first question is where I can find some …

Member Avatar for jephthah
0
259
Member Avatar for alcx88

I am not sure what this means and I get it all the time. Can someone help me fix this code? [ char add_account(account_t a[]) 7 { 8 int i, N=1000000; 9 char ch; 10 char str1, str2; 11 int m=20; 12 13 for(i=0;i<N;i++) 14 { 15 if(a[i].number==0) 16 { …

Member Avatar for jephthah
0
2K
Member Avatar for MWE_QUE

Hello, and thanks in advance for any help I can get. This is part of a larger program for homework. Things were working when I called "addVacantStore" the first time before I wrote the search function. I then called it twice more to set up to test the search function. …

Member Avatar for Banfa
0
170
Member Avatar for Iam3R

Hi, I have written a program just to check the behaviour of the compiler. i expected an error in function call statement. but its not generating any error. the declaration of function we include to check the type of args and no of args and return value of function. but …

Member Avatar for Banfa
0
160
Member Avatar for detito

Write a C code to Simulate the binary erasure channel (BEC) and the binary symmetric channel (BSC). The decoder should run for Nmax iterations or until it finds a codeword, whichever is earlier. Encoding: For iterative decoding problems, assume that the all-zero-codeword is transmitted • Frame error rate (FER): It …

Member Avatar for Nick Evan
-3
92
Member Avatar for jephthah

goin on over in C, yes they are. [URL="http://www.formatny.com/blog/wp-content/uploads/2009/04/umad.jpg"]U Mad?[/URL] oh, yeah. we mad. .

Member Avatar for jephthah
0
146
Member Avatar for alcx88

I am brand new to all this and I can't get my program to read the file from input. Here is my code. It says segmentation fault (core dumped) I'm assuming because fp is not getting the file information. Can anyone help? [code]#include <stdio.h> #include <ctype.h> #include <stdlib.h> #define getchar() …

Member Avatar for alcx88
0
264
Member Avatar for lionaneesh

Exercise 1-18. Write a program to remove trailing blanks and tabs from each line of input, and to delete entirely blank lines. I have no idea about this program . 1. first tell me the meaning and what to do in this question? 2. second provide me the source code …

Member Avatar for Ancient Dragon
-1
172
Member Avatar for juniper2009

I would be very happy if you could explain to me clearly to understand the void insertAtRear() function. I want to make an insertation like void insertAtRear(int i, string s, string n) { //how can i implement this function // i need to }

Member Avatar for VernonDozier
0
170
Member Avatar for sudiptamondal

[CODE]#include<stdio.h> #include"graphics.h" #include<stdlib.h> #include<conio.h> void main() { int graphdriver=DETECT,graphmode; int color,n,m; initgraph(&graphdriver,&graphmode); for(n=0;n<10;n++) { putpixel(250+n,350,BLUE); } for(m=0;m<10;m++) { int x=getpixel(250+m,350); printf("%d",x); } getch(); } [/CODE] I have to compile programs using graphics.h but i use Microsoft visual studio 6.0 . There is no graphics.h file in it... so i copied …

Member Avatar for hkdani
0
483
Member Avatar for serious01

I am a student at Makerere university in Uganda and i have started programming using Java, C and Swi- prolog

Member Avatar for jephthah
0
46
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
174
Member Avatar for ItecKid

Hello, all, I am writing an x86 function that is called, with arguments, from a C program. Which registers does x86 store these arguments in?

Member Avatar for Salem
0
68
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
159
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
192
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
586
Member Avatar for Darkest Shine

I need to scan for the following input type using C: number letter number so i used the follwing: scanf("%d%c%d", &n1, &lett, &n2); Unfortunately with this, whenever I attempt to input a single number and press enter, scanf continues to expect another input. How can I adjust the program so …

Member Avatar for Salem
0
153
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
495
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
103
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
473
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
82
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
194
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
90
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
124
Member Avatar for 42below

Hello to all, I'm a 44 year old with a little knowledge about computers and programming in general (a little knowledge is a dangerous thing!) I bought a book on Python in 1997 and started from there really. University courses introduced me to Pascal back in 1984. In the last …

Member Avatar for qlipboard
0
44
Member Avatar for TheWolverine

Hi all, I am in the process of optimizing my code and I was wondering what the fastest way is to compute trig functions. I profiled my code and to my astonishment discovered that one of the most time-consuming processes is computing cos(theta) and sin(theta) using the implementation of cos() …

Member Avatar for nezachem
0
150
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
113
Member Avatar for Member #728458

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
402
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
90
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
128
Member Avatar for Member #728424

Hello, I am really a beginner with Assembly, and I'm currently working on a program in which I receive a string of numbers, separated by spaces. I will have to perform some operations with these numbers, one at a time, but for that I have to recognise when a number …

0
47
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
217
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
117
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
169
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
130
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
193
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
236
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
535
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
153
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
200
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
188
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
418
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
186
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
710

The End.