15,551 Topics
![]() | |
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 … | |
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: … | |
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. … | |
plz suggest a simple C program to find out greatest number using array.... | |
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 … | |
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 … | |
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 … | |
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. | |
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. … | |
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 … | |
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 … | |
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() { … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
/*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); } | |
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; … | |
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 … | |
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 … | |
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 … | |
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] | |
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. … | |
I am also havin the same difficulty, when i am trying my code in linux (ubuntu) using gcc. | |
hi there everybody, i want to include exe files through file handling commands.how can i do this? regards monto | |
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 … | |
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. … | |
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 = … | |
[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 … | |
[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 … | |
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 … | |
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] … | |
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. … | |
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 … ![]() | |
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: | |
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 … | |
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. | |
Please help me to resolve my problem. How to print a set of character in bold form in "c" or "c++" language. | |
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 | |
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 … ![]() | |
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; … | |
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 … | |
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.... | |
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 … |
The End.