15,551 Topics

Member Avatar for
Member Avatar for emilio

hello i wonder if there is a way to return an array in function like in java lang for example: int[] ret (int i,int j) { int[] a = (i,j} ; return a ; } or can i ewturn a pointer to a new array? i need it for function …

Member Avatar for Duoas
0
99
Member Avatar for LilLady

The assignment is as follows: 1. Print name 2. Ask user "How many cycles?" and accept integer answer. 3. Ask user "How many samples per cycle?" and accept integer answer. 4. Calculate total number of samples and allocate an array of doubles to hold them. Initialize doubles to zero. Hint: …

Member Avatar for Duoas
1
144
Member Avatar for tu_m.aimes

I'm trying to sort a list of names alphabetically, by isolating the first element of the string and compare, which I think should work, but there's an error, SISEGV with something about an invalid access to storage... I don't know, but my group mates and I can't figure this out. …

Member Avatar for Duoas
0
155
Member Avatar for poiuy

plz suggest a simple C program to find out greatest number using array....

Member Avatar for Salem
0
63
Member Avatar for garap
Member Avatar for Narue
0
62
Member Avatar for deadswitch

Hey folks -- DaniWeb has helped me a lot with various other programming projects, but I've run into a snag that I just can't get myself to understand. Hooray for vague compiler errors. Hopefully someone here can show me the error of my ways. I'm making a little game, based …

Member Avatar for Aia
0
139
Member Avatar for FoX_

Hi all... How can I control any postfix expression is valid or not??? I controlled it using a stack(the code is below) and it worked but I 'm using the stack again after clearing it for evaluation the postfix expression to the infix expression.I'm using the stack twice and I …

Member Avatar for FoX_
0
2K
Member Avatar for vinaychalluru

Hi,every one I am going to find whether the given number is a armstrong number or not and I have done my level best and I need your help in one thing,If any mistakes,please reply and I need your other views to develop my C skills.hope help from you all …

Member Avatar for Narue
0
78
Member Avatar for Majestics

Can Any One Tell Me How To Handle Registers In C ,while We Are Dealing With Mouse Handling ... Can Any One Explain With Some Example.

Member Avatar for Ancient Dragon
0
82
Member Avatar for dangerd

I have a systems programming problem. Its a group of small programs that interact with each other to implement a mutual exclusion problem. I was wondeing if somebody could comment them to help me understand them better. Would be very much appreciated. They are toilets shared by boys and girls. …

Member Avatar for fuhaohowy
0
90
Member Avatar for piscean123

Need your help in this code too.. this is the program to convert any entered number into its hexadecimal equivalent but the problem is that same result is printed for any number...:'( :'( [CODE]int main (void) { int n; printf("Enter Number :"); scanf("%d", n); printf("Hexadecimal Equivalent %x", n); getch(); return …

Member Avatar for piscean123
0
139
Member Avatar for fhshockey05d

The ultimate goal is to send simple messages ("GH", "HC", etc.) to a CMUcam2 and to read what messages I get back. I need help in setting up a serial communications port in Windows. I have seen how to open the port on other threads on this website, but I …

Member Avatar for Ancient Dragon
0
201
Member Avatar for binaryboy

Hi all, Having some trouble with an assignment. My program should store lists of names and ages and sort the list by name (alphabetic). Here's my current attempt [code=c] #include<stdio.h> #include<string.h> // struct to hold the data typedef struct _data { char name[5][30]; int age[5]; } data; int main() { …

Member Avatar for Ancient Dragon
0
133
Member Avatar for cjwenigma

Hello.. I'm trying to use OpenGL to draw the great pyramid model and have it rotate.. i'm having trouble with my points as you can see they are commented out. I'm also trying to figure out how to turn the eye point and how to rotate it... here are my …

Member Avatar for jbennet
0
415
Member Avatar for Pierrot le fou

Hello ! I am looking for a paper that reviews the currently available commercial C compilers, in order to choose one of them. My principal expectations for a C compiler are: efficient debugging, user-friendliness and optimisation possibilities... So far, I selected more or less two compilers (Visual C++ and Borland …

Member Avatar for Narue
0
101
Member Avatar for asilter

i have a loop displaying current number of file which is being created. [code] for(i=1;i<=nFileCount;i++) { ... printf("%d. file has been created\n",i); } [/code] but i dont want the display to write ". file has been created." again and again as a list. I want only the i change. how …

Member Avatar for Salem
0
94
Member Avatar for ITapprentice

I am opening a file for writing and changing it a bit. I have changed all uppercase characters to lowercase. I have also deleted all characters that are not alphabetic, but I can't delete apostrophes that occur after and before another alphabetic character (i.e. the word "there's" or "don't" would …

Member Avatar for Narue
0
217
Member Avatar for locy

how do i write the following functions:can somebody help me with this programm? [code] int lengthOfString(char *string); [/code] the longer the text that is given,the longer the text caculation [code] int letsFactorise(int charCount); [/code] the length of the texts in order of prime number,if no prime numbers then give Error-code …

Member Avatar for Aia
0
77
Member Avatar for theteamdrunk

I am writing code that accepts a string of a filename, then capitalize the letters, not changing any numbers or special characters. I think I am on the right path, but can some one give a little push to the right direction. [code] #include <stdio.h> #include <string.h> #include <stdlib.h> #include …

Member Avatar for Aia
0
210
Member Avatar for piscean123

Peoples i have tried to make this simple progrem in C... that will print alphabets A to Z and their equivalent ASCII code.. like this A 65 B 66 . . . Z here is da source code... int main (void) { char code; for(code = "A";code <= "Z"; code …

Member Avatar for Narue
0
147
Member Avatar for rpjanaka

hi all, i want to get the dependancy graph from the make file or make rules. please if anyone can, help me to do this

Member Avatar for Duoas
0
84
Member Avatar for NatalyC

Hello everybody :) I have a problem about sorting a linked list. The following is the code that I wrote in C, it works well at this moment; it just generates random numbers, it just prints the random numbers generated and the even numbers. But I need to sort these …

Member Avatar for NatalyC
0
99
Member Avatar for abhishekgahoi

/*please try to this pg in gcc*/ #include<stdio.h> main() { char a,b; printf("enter the char for a"); scanf("%c",&a); printf("entered value of a is = %c",a); printf("enter the char for b"); scanf("%c",&b); printf("entered value of a is = %c",b); }

Member Avatar for Narue
0
31
Member Avatar for tech2chill

wap to print following pattern?? [code] ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A [/code] the pattern is not showin up proper,,but hope u guys get it.. its kinda /\ shape formation b/w those letters this is wat i tried out..... int i,j....; int m=65; …

Member Avatar for tech2chill
2
479
Member Avatar for BensonRoss

This is another problem that I'm having that goes along with a previous question that i asked. The basic program is that a person puts in two DNA strings that consist of only A,T,C,or G. DNA strings work to where A can only match with T, and G can only …

Member Avatar for Salem
0
81
Member Avatar for MiTiM

I have one problem, and i have no idea what is happening? THE output gives some strange things: type of your cpu is: amd cpu speed is: 123 enter the year when it's produced 2000 enter the price of your computer [B] scanf: floating point formats not linked[/B] abnormal program …

Member Avatar for Salem
0
284
Member Avatar for Fredszky

I spent 5-6 hours today to try to get a working searchfunction for my textfile, can someone please put me in the right direction? I have this textfile, its a register over contacts: [code] Number Contacts = 3* James Brown:555-12345:james@brown.com Jack Yellow:555-42345:jack@yellow.com Sally White:555-12345:sally@yahoo.com [/code] For example, i want to …

Member Avatar for Fredszky
0
105
Member Avatar for pdwivedi

I want to open a text file in a c program which is on desktop.How can I print the texts written in the file on screen.Please help [B]Regards Prashant[/B]

Member Avatar for WaltP
0
124
Member Avatar for BensonRoss

I am new to the world of C but am enthusiastic nonetheless, so pardon me if this appears to be a particularly basic question... I am attempting to write a program that uses DNA strands.. which consist of A,T,C,and G characters... The user is prompted to input a DNA strand. …

Member Avatar for Aia
0
183
Member Avatar for aaabhish
Member Avatar for Salem
0
164
Member Avatar for monto

hi there everybody, i want to include exe files through file handling commands.how can i do this? regards monto

Member Avatar for Duoas
0
79
Member Avatar for donaldunca

I have some problems: - How can I erase a file? - How can I create a random string has 8 letters? This is my code to create a random string has 8 letters: [CODE] char *b=""; int i,j; FILE *f=fopen(file,"w"); for(i=0;i<4;i++) { for(j=0;j<7;j++) *b+=char(random(27)+65); fprintf(f,"%s\n",&b); } fclose(f); [/CODE] But …

Member Avatar for Ancient Dragon
0
108
Member Avatar for redaqen

EDIT: Please note, this assignment was already submitted. Well for our assignment this time around, we had to write up a BASIC editor. It had to sort lines of code numerically. Each line would never be more than 80 characters long and there would never be more than 100 lines. …

Member Avatar for Ancient Dragon
0
155
Member Avatar for asilter

unsigned int is 4 bytes in the system i'm programming. i printed sizeof(unsigned int) and it said 4. [code] int main(int argc, char * argv[]) { unsigned int a = 0; long int b = 2607503366; /* the b data type must strictly be a long int */ a = …

Member Avatar for Salem
0
114
Member Avatar for asilter

[code] unsigned int nBolum = 0; unsigned long nKalan = 0L; unsigned long ulA = 0L; unsigned long ulB = 0L; ... printf("ulA=%u\n",ulA); printf("ulB=%u\n",ulB); nBolum = (unsigned int) ulA/ulB; nKalan = (unsigned long) (ulA%ulB); printf("nBolum = %u\n",nBolum); printf("nKalan = %u\n",nKalan); ... [/code] it prints; [code] ulA=2607503366 ulB=16777215 nBolum = 155 …

Member Avatar for Salem
0
155
Member Avatar for asilter

[code] unsigned long nBolum = 0L; unsigned long nKalan = 0L; unsigned long ulA = 0L; unsigned long ulB = 0L; ... printf("ulA=%u\n",ulA); printf("ulB=%u\n",ulB); nBolum = (unsigned long) ulA/ulB; nKalan = (unsigned long) ulA%ulB; printf("nBolum = %u\n",nBolum); printf("nKalan = %u\n",nKalan); printf("HVFE.c exiting\n"); exit(1); [/code] it prints : [code] ulA=2607503366 ulB=16777215 …

Member Avatar for asilter
0
3K
Member Avatar for Ratte

I have a file of 14 functions. I know I need an extern array of 14 bools. If something goes wrong in one of these functions, the function should modify its respective array member to false. I want the main program to be able to access the array members to …

Member Avatar for WaltP
0
100
Member Avatar for nikolaos

i have the following struct [code] typedef char * typos_stoixeiou; typedef int metritis; typedef struct korifi *kdiktis ; struct korifi { typos_stoixeiou dedomena; metritis counter; int kleidi; int arithmospaidiwn ; korifi *a[100]; }; [/code] if i try this [code] for(int s=0;s<size;s++) { root->a[s] = (kdiktis)malloc(sizeof(struct korifi)); root->a[s] = NULL; }[/code] …

Member Avatar for Duoas
0
163
Member Avatar for Ratte

I need to write wrapper functions for fork and signal functions. These functions will handle errors by fork() and signal() and exit, if an error occurs. The problem is I am not sure exactly what to check for on either function. Here is some sample code for both of them. …

Member Avatar for Ratte
0
464
Member Avatar for Ratte

I am writing a server function and an error message is defined as: [code] #define UNKNOWN "Unknown" [/code] I have a function: [code] void search(int sockfd) { FILE *file; char arg1[MAXLINE], arg2[MAXLINE], title[MAXLINE], line[MAXLINE]; file = Fopen (PATH, "r"); while (true) { if (Readline(sockfd, title, MAXLINE) == 0) return; Fgets …

Member Avatar for iamthwee
0
148
Member Avatar for toxic

hello. i'm new here and new to C programming so would appreciate any help with a problem i have. how can i copy the contents of a command line argument e.g. argv[1] to a string declared within main() e.g. filename[30] cheers..... PS this isn'y my homework:lol:

Member Avatar for Duoas
0
17K
Member Avatar for phylon

Hello I am having no problem while returning 1 dimensinal array But am having trouble with 3 dimenional array No problem with this code [CODE]float Mat[][][]; float Mat[]; float *funct1(void) { return Mat; } void funct2() { float *Mat; Mat=funct1(); } [/CODE] But this doesnt work [CODE] float Mat[][][]; float …

Member Avatar for mank
0
102
Member Avatar for piscean123

Can anybody give me the source code of ANY of the following programs.... me newbie to C.... 1. Write a program which takes 10 numbers as INPUT and tell which one is GREATER. 2. Write a program which takes 10 numbers as INPUT and tell which one is SMALLER.

Member Avatar for piscean123
0
100
Member Avatar for pogosecure

Please help me to resolve my problem. How to print a set of character in bold form in "c" or "c++" language.

Member Avatar for Duoas
0
43
Member Avatar for muwaheedibrahim

can ayone share his knowledge related with hardawre and networking with me so that i earn my livelyhood from the start and in return ill pray from THE ALMIGHTY for increase his knowledge! thanks

Member Avatar for Ancient Dragon
-2
31
Member Avatar for chorei

hey all i have a real problem with fibonacci numbers i have calculated max fib(47) with my codes but i have a project that i need to calculate the n'th fib number which is get from the user and print the fib valu to the screen the numbers must be …

Member Avatar for iamthwee
0
252
Member Avatar for #include_rose

I keep getting this warning every time I compile the following code. Can anyone please tell me what I am doing wrong. Also, the printf(head->data) keeps saying that printf's argument is invalid. How do I print head's data? Any help is appreciated. Thanks, [CODE]#include<stdio.h> #include<malloc.h> typedef struct { int data; …

Member Avatar for #include_rose
0
295
Member Avatar for Aarthi Gopal

i had a prob wen i had to sort each column of a matrix. the prob s wen i use larger values say 2453,23465 etc. the sorted matrix returned garbage values.. y s that? n how do i find factorial for 300 n bigger numbers?? i'm not able to store …

Member Avatar for Ptolemy
0
108
Member Avatar for n.aggel

hi, i want to begin socket programming and interprocess communication but i don't where to begin....can anyone suggest some sources?? thanks in advance, nicolas PS:: sorry if the question is vague, but it isn't easy to be more specific....

Member Avatar for stupido
0
191
Member Avatar for locy

How do i write a programm that the given text.the longer the text will factorized (in primenumber order).The text is for the following transformation as matrix with the Dimention [B]n[/B](breath;smaller Primefactor) multiply [B]m[/B](highest;bigger Primefactor).The letters of this matrix will in column by column displayed the output format is the transpose …

0
81

The End.