15,550 Topics

Member Avatar for
Member Avatar for Adox

Hello, I was wondering if someone could help me in this case. I need the program to open a txt file. But the User shall inform the location where the file resides. Can be by text. Example: "C: \ documents \ test.txt". To open files I know just the fopen.

Member Avatar for rubberman
0
222
Member Avatar for rakesh.menon.16

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 …

Member Avatar for rubberman
0
469
Member Avatar for shaneetra.graham

I was having a little trouble with parsing my command upon input, I'm new to C so any help would be greatful! Here is what i have so far i'm trying to make a simple unix shell char*token; while(1){ //prints users prompt printf("\n%s@myshell:%s>", username,curDirect); //gets string from command line fgets(buffer, …

Member Avatar for Ancient Dragon
0
165
Member Avatar for getmeusername

Hi All, I am new to c programming. I have mulptiple c files which uses the client.h Currently I am using my header file in each and every place where my c code is placed. Can I put it at one particular location and use it as #include<client.h> in my …

Member Avatar for Ancient Dragon
0
198
Member Avatar for nakul_pancholi

Dear all, I am learning C language. I got the following problem while running the problem. Program: [CODE]#include <stdio.h> #include <math.h> #include <stdlib.h> main() { int x; for (x = 1; x <= 250; x ++) printf("x = %d\n", x); }[/CODE] OUTOUT should be: x = 1 x = 2 …

Member Avatar for arulgee6
0
1K
Member Avatar for mvmalderen

One of the things which attracted my attention was that there are often newbies asking how to create a password program in C/C++, often they don't succeed, well here's my response, you can use it for any purpose you want, one thing you'll have to keep in mind is that …

Member Avatar for Remy1990
0
8K
Member Avatar for David W

In the last few days, I have noticed a very old thread ... resurrected ... about a non-standard C getline function. To all who may like a C readLine function ... a C function that reads in a dynamic C string of any length ... a function with a similar …

0
211
Member Avatar for john.kane.100483

OK so I'm almost done with my program. How to put this in function like putting each case like void Binary2Decimal() , void Octal2Decimal() & , void Hexa2Decimal() in "TURBO C++"? Call a function like I only want to display only the Binary to Decimal case. #include<iostream.h> #include<conio.h> #include<stdio.h> char …

Member Avatar for pritaeas
0
132
Member Avatar for kamil_2

I installed the New version of dev c++ 5.6 for implement graphics programmes in c and i done all the steps like put graphic.h files,and add linkers in parameters. i done every step correctly but when i go to compile the simple graphics programme it will show the error line …

Member Avatar for Ancient Dragon
0
183
Member Avatar for taverasme

Hi all, First time poster here, I've referenced posts here on daniweb in the past and it has always been helpful, thanks! But I can't find the answer to this particular problem here on the forums. I need to write a basic string parser as part of a coding assignment …

Member Avatar for Nikolas9896
0
6K
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> int main() { int i=1,fact=1,n; printf("enter the no of fact: "); scanf("%d",&n); factorial(n,fact,i); return 0; } int factorial(int x,int y,int z) { int r; if(x==1) { r=y*z; printf("the fact is %d",r); } else { factorial(x--,y*z,z++); } } hello iam trying recursion using factorial the complier stops …

Member Avatar for Reverend Jim
0
146
Member Avatar for chipo

I am trying to parse a date stored as an array of characters. I have a problem to paerse the date with a loop otherwise it works fine. char date[]="20141018"; //the date is 10/18/2014 char _mypointer=date; char year= "YYYY"; char month="MM"; char day= "DD"; year[0]=*my_pointer + 0; month[1]=*my_pointer +1; What …

Member Avatar for David W
0
157
Member Avatar for Snehamathur

[CODE] /* Any year is input through the keyboard. write a program to determine whether the year is a leap year or not. */ #include <stdio.h> #include <conio.h> void main(void) { int year; clrscr(); printf("\n\n enter a year::"); scanf("%d",&year); if(year%400==0) printf("\n\n Leap Year."); else if(year%100==0) printf("\n\n Not Leap Year."); else …

Member Avatar for stephen.beatson
0
379
Member Avatar for pavani2006
Member Avatar for swaar.metaal.7

Hi everyone, I am new here and I hope all of you are doing well. I have spent the whole day searching around on the almighty Google for code that can help me with my problem. In the following code there may be quite a few n00b mistakes, and for …

Member Avatar for swaar.metaal.7
0
269
Member Avatar for yann.bohbot.9

hey everyone! having a small problem with my pointer. I'm just trying to scan an array using a pointer but when i print it it shows me only zeros. Any help? #include <stdio.h> int main() { int arr[10]; int *ptr; int i; ptr = &arr[0]; printf("Enter 10 integers:\n"); for (i=0; …

Member Avatar for sepp2k
0
128
Member Avatar for it mansoor

write a program in c who get input from key board and then show the addition of numbers

Member Avatar for Deep Modi
-2
170
Member Avatar for glao

(Continued from [here](http://www.daniweb.com/software-development/cpp/threads/474128/column-major-not-shown-right#post2070227) ) I am trying to use column major order to a 2d matrix which I am using as 1d. int N=3,R=2; for (int i=0;i<N;i++){ for (int j=0;j<R;j++){ //printf("\nX[%d]=%d\t",i+j*N,res[i+j*N]); //column major // printf("\nX[%d]=%d\t",i*R+j,res[i*R+j]); //row major } printf("\n"); } but the column major doesn not work as it should. …

Member Avatar for David W
0
437
Member Avatar for COKEDUDE

Can you please explain what this weird int declaration does. Here is the block of code. void show(void *u, int w, int h) { int (*univ)[w] = u; printf("\033[H"); for_y { for_x printf(univ[y][x] ? "\033[07m \033[m" : " "); printf("\033[E"); } fflush(stdout); } This is the line I'm talking about. …

Member Avatar for Ancient Dragon
0
253
Member Avatar for Jason_9

I'm totally new to programming and taking an intro class. When i prompt the user for a state code the program just exits, nothing in my book really goes over this and all im given is crappy youtube videos for reference. Any help is greatly appreciated. #include <stdio.h> #include <stdlib.h> …

Member Avatar for David W
0
260
Member Avatar for COKEDUDE

Can someone please explain what unistd.h does and the purpose of it? I have been googleing the last hour and I don't understand it.

Member Avatar for COKEDUDE
0
129
Member Avatar for churchill.omorere

Design a C program that will convert temperature values from degrees Celsius to degrees Fahrenheit. The user must enter a start and a finish value, together with a step value. The program must convert all temperatures beginning with the start value at the given step interval. Use the …for()… statement …

Member Avatar for BobS0327
-1
170
Member Avatar for jalferez1

i asked this on the C++ forum but someone told me to try it here on C. here's my first program there are some error with this program, i can't debug it. what's the problem? #include <stdio.h> #include <conio.h> #include <ctype.h> #include <string.h> int main(void) { int strlen, a, b,c; …

Member Avatar for jalferez1
0
217
Member Avatar for kalyan_1

Could some one help me out with the basics of Structures ? How to use them in C programs ? etc.. Thanx in advance.

Member Avatar for David W
0
130
Member Avatar for nitin1

hi, Can anyone suggest me the approach for finding the lcm of the n numbers? my approach: find the max of the n numbers and start dividing it by all numbers , if all are dividing it then print it, else take next multiple of the max number and repaet …

Member Avatar for ShapesInClouds
0
3K
Member Avatar for Tinnin

Hi all, I've bought the book "Objective-C Programming - The Big Nerd Ranch Guide" and I'm running through the beginning chapters which just regard C. I'm doing this on my laptop running linux as I don't have a Mac (yet). I'm having trouble with this code: #import <stdio.h> #include <readline/readline.h> …

Member Avatar for Tinnin
0
2K
Member Avatar for coding101

I need to create a scenario where all 65535 ports are open. I currently can open 1021 socket desciptors and bind to 1021 ports. If i spawn ~ 70 processes todo the same, i can achieve the goal, but performance is slow. I'm not interested in packet sniffing. How can …

0
72
Member Avatar for nyt1972

Hello, Hope this is the right place to post, I am a student and want to create an OS like DOS just for practice, I know functions, arrays, pinters, structures and file handling but dont know how to start writing an OS, please help me. Regards.

Member Avatar for imawesome511
0
4K
Member Avatar for kalyan_1

Having trouble understanding pointers . Could anyone please help me out ? thanx in advance.

Member Avatar for David W
0
128
Member Avatar for ajit.nayak

I am trying to create Menu Selection process.if SELECT button pressed once should display the Display parameter and if select button pressed twice should goes to Set_parameter window(Where we set parameter). once it is display parameter using up and down arrow Choose the Display window .But problem i am facing …

Member Avatar for Banfa
0
159

The End.