15,552 Topics

Member Avatar for
Member Avatar for vic18
Member Avatar for krille_x

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 …

Member Avatar for Narue
0
166
Member Avatar for illuminatus89

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?

Member Avatar for manojwali
0
101
Member Avatar for king chandel

hi all,I want to learn assembly language.I know nothing about it.can anyone suggest me any book for begginers? thanx a lot

Member Avatar for Auraomega
0
88
Member Avatar for scholar

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 …

Member Avatar for Adak
0
158
Member Avatar for challarao

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, …

Member Avatar for Adak
0
121
Member Avatar for lucy1234

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.

Member Avatar for Adak
-5
2K
Member Avatar for koti86

I unable to download e-books from google can you tell any tips for download free of e-books in a linux platform.

0
57
Member Avatar for falconwise

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 …

Member Avatar for falconwise
0
158
Member Avatar for chii18

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++) { …

Member Avatar for prvnkmr449
0
94
Member Avatar for jeevsmyd

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 …

Member Avatar for Auraomega
0
419
Member Avatar for xshashiy

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 …

Member Avatar for DKdontKNO
0
541
Member Avatar for avanish_yadav

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 …

0
95
Member Avatar for GMSI

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.

Member Avatar for Adak
0
760
Member Avatar for ROGENATOR

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

Member Avatar for prvnkmr449
0
203
Member Avatar for ashwinikuma

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: …

Member Avatar for Ancient Dragon
-1
74
Member Avatar for JSpudMonkey

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 …

Member Avatar for Ancient Dragon
0
144
Member Avatar for b1izzard

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 …

Member Avatar for b1izzard
0
126
Member Avatar for falconwise

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]; …

Member Avatar for falconwise
0
111
Member Avatar for rtirak

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 …

Member Avatar for rtirak
0
166
Member Avatar for challarao

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 …

Member Avatar for Ancient Dragon
0
132
Member Avatar for Danny_501

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, …

Member Avatar for IsharaComix
0
143
Member Avatar for sabeeh ahmed

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

Member Avatar for sabeeh ahmed
0
89
Member Avatar for dayju

#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 …

Member Avatar for dayju
0
143
Member Avatar for sourisengupta

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.

Member Avatar for sourisengupta
0
98
Member Avatar for Davish

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!!

Member Avatar for kings_mitra
0
94
Member Avatar for Danny_501

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 …

0
61
Member Avatar for amarnathch

How could i know the total elements an array can store??? whether it depends on the datatype or os(32bit or 64bit)???

Member Avatar for Narue
0
93
Member Avatar for reginaj

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> …

0
45
Member Avatar for creeps

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 …

Member Avatar for creeps
0
100

The End.