19,876 Topics

Member Avatar for
Member Avatar for jsphb9000

Hi all, So I'm trying to do this checksum problem for my C programming class but im running into some difficulty. My output is supposed to be this: Line: This is short. Checksum: 2 Line: The quick brown fox jumped over the lazy dog. Checksum: = Line: A. Checksum: O …

Member Avatar for Aia
0
177
Member Avatar for yuvaraj.tr

Hi , I have one buffer size is 50 bytes and reading 50 byte data from file unsigned char bufffer[50]; read(fd,buffer,50); // Consider each byte numerical is value is zero. printf("@@%s@@",buffer); // Here i will get @@@@ only. But I want @@(50 zero)@@ as output(i have to use %c or …

Member Avatar for jephthah
0
80
Member Avatar for westsider123

I'm having trouble with this code, I want to make the answer in (^)and(*) Example : Enter number : 8 Prime factors of '8' : 2^3 Enter number : 56 Prime factors of '56' : 2^3*7 Please help me with this, Thanks![code]#include <stdio.h> /* Find out the prime factors * …

Member Avatar for jephthah
0
428
Member Avatar for cokaznsyco72

I'm having trouble making a variable argument function for my class. When I gcc it, its giving me these errors: my_printf.c: In function `print_str': my_printf.c:14: error: syntax error before '{' token my_printf.c:20: error: syntax error before "__builtin_stdarg_start" here's a code snippet: [CODE]#include <stdio.h> #include <stdarg.h> #include "my_io.h" // ASCII definitions …

Member Avatar for jephthah
0
197
Member Avatar for adxer

Hey I'm having trouble using scanf to input two number and it is only letting me input 1. here is my code [ICODE] #include <stdio.h> int main() { int i ; int j ; int tl[10][25] ; int br[40][5] ; int point1[100][100] ; for(i=0;i<40;i++) for(j=0;j<25;j++) { printf("please enter value x,y …

Member Avatar for dfetter88
0
319
Member Avatar for j.kelly

I am new to C++ and cant get my program to compile because of #include recursion. I have 3 classes A, B, C. A includes B.h and C.h B includes A.h C includes A.h and B.h They include each other because they either need to send messages between themselves. No …

Member Avatar for faaano
0
2K
Member Avatar for javedkhan0258

I have these structs. and I have two files one is program.dat and other is course.dat and I am supposed to load the values from those .dat files to the struct. The separation between attributes in program.dat and course.dat is '|' for example programID|programTitle|ProgramCode........ and I have used string tokenizer …

Member Avatar for abhimanipal
0
104
Member Avatar for gear26926

Cud any1 let me know how this code works with respect to pecedence and associativity Thanks in advance[code]#include <stdio.h> main() { int i = -3, j = 2, k = 0, m; m = ++i && ++j || ++k; printf ("\n %d %d %d %d", i,j,k,m); }[/code]

Member Avatar for jephthah
0
117
Member Avatar for Banfa

[QUOTE]This discussion has been moved from [url]http://www.daniweb.com/forums/thread284115.html[/url]. Check there for the beginning.[/QUOTE] = = = = = = = = = = = = = = = = = = = = Actually neither approach is wrong. The original code does not store prime numbers but does correctly identify all …

Member Avatar for 0x69
3
308
Member Avatar for addxztion

So uhm...I want to do the bubble sort and i found a code but actually i don't really know what's missing...ok...sorry but i am just a newbie and not so average of logic(lol. :p). My goal here is to complete this code, 'cause i tried to run it but it …

Member Avatar for addxztion
0
169
Member Avatar for cutedipti

Hello, Can anybody help me on the issue below:- [B]'Features of C language that uses indirect addressing mode.'[/B] I didn't get it's meaning exactly. Whether it is Function 'Call By Value', as we are not refering direct address of variables like in 'Call By reference' or anything else. Please help …

Member Avatar for Ancient Dragon
0
181
Member Avatar for ramakrishnaramk
Member Avatar for mr.confused!

In your opinion, when creating a nested loop is it best to use the call function and if so is using a pointer the route to go when creating the function?

Member Avatar for jephthah
0
146
Member Avatar for hetalraithatha

Hi Everyone, I would like to get some help in a way to convert C code to DLX assembly code.I have tried to search if there are tools available which would perform this, but whatever I find is to convert to MIPS assembly code. Guidance to move further in this …

Member Avatar for UncleLeroy
-1
578
Member Avatar for dfetter88

As you probably know, Shell sort is typically written with a base of insertion sort, as shown below: [code]for (ctr = numGaps - 1; ctr >= 0; ctr--) { k = gapSeq[ctr]; /* Insertion Sort Begins Here */ for (j = k; j < size; j++) { tmp = array[j]; …

Member Avatar for dfetter88
0
82
Member Avatar for skypower

Hello there! I have an exercise that askes me to create a binary file .dat with a structure in it. I have to run it like this: a.out something.dat. Also I have to create a command prompt for the user (input). I am very confused since I don't have linux! …

Member Avatar for skypower
0
131
Member Avatar for purvi12345

C-implementation of M-ary/multiway tree...... madam has asked me to do it as part of my project.... node will contain simple integer numbers.... i didn't code any code for it in book/internet..... plz help,Thanks in advance......

Member Avatar for Tellalca
-3
1K
Member Avatar for 234pramod

Hi, I want to receive data which a device which is sending on usb. How can I receive data.Will there be any C codes available for that? I am very new to device programming.All suggestion are welcome.?? I want how to interface it and get the data.I want to do …

Member Avatar for 234pramod
0
122
Member Avatar for freemanirl

Okay, so I've been looking at this for quite some time. I think I know what the problem is, but my C++ skills are sad a best due to stuff like Java, C# and VB. So, I'm trying to pull information from the registry, and I have no problem getting …

Member Avatar for freemanirl
0
203
Member Avatar for jamdownian

After the user inputs idnum and password. If thats correct the loginwindow is suppose to minimize and the mainwindow is suppose to come up. The main window comes up but the login window wont go away. :icon_evil [U]login window[/U] [ICODE]http://i41.tinypic.com/15ceblf.png[/ICODE] [U]main window[/U] [ICODE]http://i40.tinypic.com/121v2bk.png[/ICODE] [U]my problem[/U] [ICODE]http://i43.tinypic.com/4sjvy0.png[/ICODE] [CODE] if (userName_login_window.Equals("1") && …

Member Avatar for jamdownian
0
116
Member Avatar for GlaDiuS89

Hi guys. So, i'm suppose to make a translator, here's my form: [URL=http://img213.imageshack.us/i/12081833.jpg/][IMG]http://img213.imageshack.us/img213/6067/12081833.jpg[/IMG][/URL] When i press the middle button i have to check every word from left memo (MEMO1) and insert the translated word in the memo on the right (MEMO2). So my middle button has the following code : …

Member Avatar for daviddoria
0
450
Member Avatar for harshchandra

This program generates different combinations of a number or a string as given by the user.just a simple implementation of arrays.

Member Avatar for Nick Evan
-2
266
Member Avatar for speedy94519

Hey you guys. Im doing c code where i have to make a file full of double values and then make another empty one because im going to write into that file. It does compile but i get this: Enter the input file name: randomfile.dat Enter the output file name: …

Member Avatar for WaltP
0
201
Member Avatar for srinu san

I want user defined function i.e.power()function programn using function concept in c language.

Member Avatar for mrnutty
-1
43
Member Avatar for 3cats

I closed out the other post I had "fill 2d array". The assignment is to read in a file to a 2d array that has the month #, high temp, low temp for each month. Then calculate the aver high and aver low and give the highest and lowest temps. …

Member Avatar for 3cats
0
136
Member Avatar for AndrewYY

For the sake of readability, I've been trying to do something like this: [CODE]#define initialize(x)(type x = initfunction()) int main(){ initialize(example); example.item = 0; return 0; }[/CODE] where type is a typedef'd struct, and initfunction() generates one, inits values, and returns it. My problem is, I get these errors: warning: …

Member Avatar for 0x69
0
3K
Member Avatar for COKEDUDE

Here is a good listing of library functions. [url]http://www.cplusplus.com/reference/clibrary/cstring/[/url]

Member Avatar for COKEDUDE
0
95
Member Avatar for skypower

Hello, I am having some strings grammar problems. [CODE] char *eisodos1[50]; char e; int *a; int i; int main() { eisodos1[i]=getchar(); (1) e=eisodos1[i]; (2) if (eisodos1[i] == ' ') g++; (3) while ((e!=EOF) && (a!=EOF)); (4) } [/CODE] Please don't look the code like a complete program, I posted the …

Member Avatar for eager
0
193
Member Avatar for nishankyadav

HI, i am Nishank and have got a project -to make periodic table by using the following a. Data Structure b. Object Oriented Programming in C++ c. Data File Handling through the program the user should be able to: a.view the periodic table b.edit the periodic table c.delete a record …

Member Avatar for Ancient Dragon
0
6K
Member Avatar for shekar.bdn
Member Avatar for skyspace_as
-2
98
Member Avatar for stirredo

have just "finished" learning C. By finished, I mean I have learned all the basics in plain vanilla C (command prompt style). I want to get into windows developement so that i can create something useful. What should be my next step? Should i be learning a object oriented language …

Member Avatar for Ancient Dragon
0
74
Member Avatar for BabyPink

Hi guys, I badly need ur help.. well am nt zat gud in C programming. I've gt an assignment on a Video Club. To maintain 'its list of videos,the number of copies available for rental, the rental price, date on loan, the return date. Each video record should be represented …

Member Avatar for Ancient Dragon
0
87
Member Avatar for Reprise

I have the following code which basically acts as a typewriter: [code] int main () { char c; puts ("Enter text:"); do { c=getchar(); putchar (c); } while (!feof(stdin)); return 0; } [/code] However when I feed it a text file for input: [icode]$ ./typewriter < input.txt[/icode] it always adds …

Member Avatar for Reprise
0
92
Member Avatar for daino

Hi Would anybody be able to tell me if there is a book or any material ot there explaining what kind of widgets you can get for C++. I'm not sure what kind of widgets are available in terms of functionality. When I say types I mean say textbox or …

Member Avatar for daino
0
164
Member Avatar for chained

Suppose if I have a dynArr pointer and a file pointer as parameters, and in the DynArr I am storing a TYPE with an integer value and a string description. How would I put the TYPEs in the DynArr into a txt file while tabbing between the string and the …

Member Avatar for chained
0
129
Member Avatar for tcotto

Hi I've been taking a python course and now that were done the professor wants us to write a program to list all the prime numbers from 2 - 10000. Oh yea and it has to be in C. So I am very stuck and really need help. Heres the …

Member Avatar for 0x69
0
104
Member Avatar for barevhayerable

Hello everybody, is there somebody that can help?? I'm having string (my example in string 55+22)that must be inputed by keyboard .. the first part I've done to put 55 to another array 2(with strtok function) Now that I was tries for many hours to put 22 to an other …

Member Avatar for abhimanipal
0
385
Member Avatar for dinesh.isuranga

i'm a C# developer and new to C++. I have to learn about C++ due to my new Project. but no clear idea about Pointers.. therefore if someone who know about Pointers,please teach me them..

Member Avatar for abhimanipal
0
82
Member Avatar for purvi12345

it prints the integer string b.var CORRECTLY.BUT not it's individual integer constants.....WHY? (ABCD.TXT is a bin text file containing data 10110000)[code]#include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> struct st { int var[8]; }; struct str2 { char a1; float a2; int a3; int a4; char a5; char a6; int a7; char a8; }; …

Member Avatar for abhimanipal
0
154
Member Avatar for jeeter19

Hi, I'd like to copy one directory to another, including subdirectories. Each file that is copied over needs to have its own thread and each following thread must wait for the previous one to finish and exit before being created. The directory names are passed in *arg separated by a …

Member Avatar for abhimanipal
0
111
Member Avatar for notuserfriendly

I am coding 2 dynamic arrays. basically ive done the first part which requires the user to enter rows and columns, i also implemented the functions to print and fill the created arrays. now the next task is to create a SINGLE dimensional array with enough size to fit the …

Member Avatar for notuserfriendly
0
383
Member Avatar for rickymak

Why is it that in this statement "c = '\t'" is not "c == '\t'" (an additional equal sign). I read an explanation that it is because \t is a visual representation of the tab character. Isn't \n and ' ' also visual representations of a newline and space character …

Member Avatar for tux4life
0
114
Member Avatar for centrinostyle
Member Avatar for rickymak

int c; c = getchar(); while ((c = getchar()) != EOF) putchar(c); c = getchar(); I know EOF means end of file. Basically, I believe this functions is instructed to keep inputing text from the keyboard until EOF becomes the subsequent input. However, I am not sure what EOF is …

Member Avatar for Aia
0
192
Member Avatar for rickymak

This program here is supposed to count the number of occurrences blanks, tabs and newlines within the respective text you type within the program. However, after I compile the program and run it on ubuntu's terminal, all I am able to do is punch in text, space, enter etc... endlessly …

Member Avatar for tux4life
0
222
Member Avatar for rickymak

Quick question: what does "if(c == '\n') mean in this context? Is it just using '\n' as a reference for a numeric value within ASCII? which in that case would be 10, so if 10 is entered, this is when nl increments up one? { int c, nl; nl = …

Member Avatar for rickymak
0
328
Member Avatar for camdaddy09

As you'll notice this is an assignment from my computer science class, and if you look closely you'll also notice that this was due on march 3, so im not trying to get help for it. All this is for is to create some friendly competition and maybe keep the …

Member Avatar for BestJewSinceJC
-2
151
Member Avatar for mr.confused!

i'm having trouble creating a craps game for school, i'm a light weight c user and any help would be amazing!!!

Member Avatar for UncleLeroy
0
116
Member Avatar for friendfx

Hi there, recently I wrote a small C program utilising the Windows API to communicate with a device over the serial port (COM1, a real serial port of my PC). This worked fine, but I am aware of the fact that those real COM ports are replaced more and more …

Member Avatar for Jason Guo
0
2K
Member Avatar for ajithasati

Hi there, On executing the above code I'm getting the error "segmentation fault". Is it possible to manipulate a string variable which already contains a data?[code]#include<stdio.h> int main() { char *str="Hello"; char * str1 ="World"; strcpy(str,str1); printf("%s",str); }[/code]

Member Avatar for abhimanipal
0
71

The End.