15,552 Topics
| |
how can i make a program that counts a number multiple by two? | |
Hi Im rather new to this but I want to ask how to re-define the array argv[] after the program main(int argc, char *argv[]) have been called? example main(int argc, char *argv[]) //assume the program is called by: program //this would give argc=1 and argv[0]= program //but know I want … | |
Through my knowledge, I know that by declaring a variable as 'const', its stored in read only memory and at the same time I found that a const variable's value can be changed using pointers. How is it possible? | |
hi all,I want to learn assembly language.I know nothing about it.can anyone suggest me any book for begginers? thanx a lot | |
Hello friends, I have a dynamic programming problem and would like to discuss it here.The problem goes as Given an integer array A[0....i] convert it to an array of strictly increasing numbers. The operations allowed are 1)Decrease an element by amount x: cost of operation=x 2)Delete an element k: cost … | |
Hi! I have seen a function to do "atoi for converting a string to its numeric equivalent. It copes with optional leading white space and an optional + or - sign. " The structure of the program reflects the form of the input: skip white space, if any get sign, … | |
hello, i need to do 15 puzzle algorithm in C as a part of my assignment.Can i please get help for this?? thanku, lucy. | |
I unable to download e-books from google can you tell any tips for download free of e-books in a linux platform. | |
So here's my situation: I have a matrix with numbers that have 3 decimal point precision and potentially any amount of numbers before the decimal point. The matrix is printed on a file in the following format. Matrix has x rows and y columns: 1.333 2.666 4.222 3.999 5.547 4.318 … | |
please. i really don't know what to do. i must answer this problem for me to advance in other exercises. here's the sample problem: n=4 1234 123 12 1 so far, this is the code that made: #include<stdio.h> main() { int n,x,y; clrscr(); printf("n="); scanf("%d",n); for (x=1; x<=n; x++) { … | |
I am planning to create a simple bulls and cows( also know as mastermind board game) in C.The computer is supposed to make 4 digit code in which the allowed digits are 1,2,3,4,5,and 6 ! 0,7,8,9 are to omitted !! How do I make the computer create such a 4 … | |
i want to generate non repeated random numbers from 0 to 156. here is the code for the purpose. but when i try to generate the random numbers more then 1 time by using a for loop, the same pattern on numbers repeats. how to solve this problem ? #include … | |
Hello, Network Programming classes have begun for us in the college and I too have been giving it a lot of reading for the past one month. Now, when I have understood the OSI and other reference models including how various protocols like FTTP, HTTP, POP3, P2P etc works; I … | |
I have windows XP version 5.1, SP 2. Tried installing Turbo C, on ruuning the install.exe, it does not take any input from keyboard. e.g. it says press Enter to continue. When I press Enter nothing happens. CAnt even close the install window. Have to kill it to close. | |
Greetings: That`s my question, until know i`ve been doing it by a batch file that i execute then read, is there a way to do it without the batch?, what i need is to list all of the Word (.doc) files of a given directory Thanks in advance | |
I am getting many many warnings of this kind in my code. It comes every time I typecast something in my code, which I am doing to variable addresses in order to use integer arithmetic on them. How do I fix these warnings? Thank you! and warning is : send_serv.c:78: … | |
Can someone help me with my code? It compiles fine but when i run it it crashes after i input my lottery numbers. Im supposed to write a program that takes a input file with names and 6 numbers 1-50 and then the user is asked to input 6 random … | |
| I got the Segmentation fault error with the following code to concatenate two strings without using string library functions. [CODE] void string_concat() { int len1,len2,i,j; char inpt_str1[30],inpt_str2[30],concat_str[60]; /*Input string1 and calculate its length */ printf("\nEnter the String 1 : \n"); scanf("%s",inpt_str1); for(i=0;inpt_str1[i]!='\n';i++) { len1+=1; concat_str[i]=inpt_str1[i]; } /*Input string2 and calculate … |
Original Problem I have an existing 2D array that is already filled with data for a matrix. I also have a structure that has a pointer looking like this double ** pointer. That being said. Here's a miniature version of the problem [CODE]#include <stdio.h> int main (){ int stuff [2][2]; … | |
Here is what I have to do. 1)Read integers from a file 2)If it cannot be opened, display an error message and exit the program. 3) Otherwise, read an integer from the file (there is guaranteed to be at least 1). 4) If that count is 0, display an error … | |
Hi! I wrote a program on iteration of numbers means-- if n=10 ---n=10/2=5 5 is odd so 3(n)+1 upto getting 1. Here is program [CODE]#include<stdio.h> main() { int i,n,c=0; printf("n= "); scanf("%d",n); while(n!=1){ if(n%2==0){ n=n/2; } else{ n=3*n+1; } printf("%d\t",n); c++; printf("%d\n",c);/*printing no of iterations of n*/ } }[/CODE] I … | |
Hi all, why is the following code printing the wrong result? [CODE]/* Returns the current time. */ char *time_stamp(){ char *str = (char *)malloc(sizeof(char) * 23); int len; struct timeval tv; struct timezone tz; struct tm *tm; gettimeofday(&tv, &tz); tm=localtime(&tv.tv_sec); printf("\n\n\n%04d-%02d-%02d %d:%02d:%02d:%03d\n\n\n", tm->tm_year, tm->tm_mon, tm->tm_wday, tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec/1000); sprintf(str, … | |
hii QUESTION: Take any 4 integers add them and print the first and last digit of the answer the restriction is that i can only use scanf command and data types.. I AM VERY THANK FULL IF SOMEBODY SOLVED MY PROBLEM | |
#include<stdio.h> #include<stdlib.h> #include<conio.h> typedef struct { char fname[30]; char lname[30]; char MI; }stud_name; typedef struct { unsigned long idnum; stud_name name; char course [10]; int yr_level; }studtype; typedef struct { int grpnum; char subj[24]; int time_sked; int day; int units; char rmnum; }class_sked; --sir, is this a correct definition?i have … | |
Hi, Can anybody give the list of environment variable functions list. For eg. getenv() is one function which can catch the environment variable from the system. Thanks for your help in advance. | |
I want to write a program that accepts date from the user in the for mm/dd/yy and then displays it in the form yymmdd Enter a date(mm/dd/yy): 2/17/96 You entered the date 96021? The program should be in C language.....thank u!! | |
Hi all, I'm making a miltithreaded program that uses the pthreads library. One of the threads monitors the users input. my problem is when I enter a close command I get the following error: 9 [sig]...: *** fatal error - called with threadlist_ix -1 make: *** [run] Hangup I know … | |
How could i know the total elements an array can store??? whether it depends on the datatype or os(32bit or 64bit)??? | |
Hello Colleagues, I have not done C programming in years. I need some help in debugging a C program written by someone who has left our team. I have marked the lines having the error with "-->" Your kind assistance is very much appreciated. Here's the code: 1 #include <stdio.h> … | |
Hello, I've learnt a bit more C since I posted [url=http://www.daniweb.com/forums/thread302037.html]the last code review thread[/url], so I've decided to rewrite the Mystery Word application, this time using strings, pointers and pointer arithmetic, and dividing the program into files (I've only got three of those). I've also created a very basic … |
The End.