15,551 Topics
| |
Hi everyone! I`m new here in daniweb. Our Prof. want us to make a game w/ a menu. I already made the game but my main menu is the problem. how to make a menu that after the game it will ask. Do you want to try again >>> then … | |
I have a question about C and mysql. I have a C program that connect to a mysql DB. One of the tables has a cp1251-encoded cyrillic column and when I read it with C I get ???? ?? ??? So is there a way to specify the cp1251 encoding … | |
Hi All, I am facing problem with MapViewOfFile. Microsoft function MapViewOfFile() which reads part of file and returns start address of that content. This function needs some other info which is provided by functions like CreateFile, CreateFileMapping etc. UnMapViewOfFile is to close the view. I am using MapViewOfFile() to read … | |
The following is the problem to which I am attempting a solution (in fact I have found the solution, there's a small doubt in a concept):- [quote] Q4) Given a floating point number, write a program to convert it into its lowest irreducible fractional form. Note that the total number … | |
Please help me with this: [CODE]#include<stdio.h> #include<dos.h> main() { int x; for(x=1;x<=50;x++) { gotoxy(x,2); delay(1000); printf("TEXT"); } return 0; }[/CODE] I am planning to run the word "TEXT" in this program to the right side, but it didnt work. WHAT'S WRONG WITH MY CODES? | |
i have a 2d array that's array[10][10] and a double number. I want to put that number into the 1st line of the array how will i do that? array[0]=number; does not work, is there a simple way of converting it? for instance double number; double list[10][10] number=5.35 i want … | |
In the following code, why does the value of 'b' remain 16 instead of 18?? [CODE]#include <stdio.h> main( ) { int a[5], i, b = 16 ; for ( i = 0 ; i < 5 ; i++ ) a[i] = 2 * i ; f ( a, b ) … | |
make a program that have a password before you wiil enter the main menu and in the main menu there is 4 sub menu ....plz help me.......plzzzzzzzzz | |
I got this program below, but the fgets function did not work... What's wrong with this? [CODE]#include<stdio.h> main() { char name[30]; FILE *fp; fp=fopen("c:\\file.txt","a+"); printf("enter name:"); fgets(name,50,fp); return 0; }[/CODE] | |
This is my header file i want to use [CODE]#include <stdio.h> #define my #define LABOR_COST 0.35 #define TAX_RATE .085 void read_data(int* length, int* width, int* customerdiscount, double* costpersquarefoot); void calculate_values(int length, int width, int customerdiscount, double costpersquarefoot, int* area, double* carpetcharge, double* laborcharge, double* installedpricecharge, double* discountcharge, double* subtotalcharge, double* … | |
Hi, Thanks in advance for reading this message. My problem is that I need to write a program that must list the pdf files in a folder that contain a text pattern. The user writes a text and the program list the files that contain the pattern. I know that … | |
1.what Is The Difference Between Procedure Oriented Language And Object Oriented Language? 2.what Are The Drawbacks Of Procedure Oriented Language? | |
How to change the entry point of gcc compiler ? I mean the code will look like the bellow one. [CODE] #include<stdio.h> int entry() //this is the new entry point instead of main. { return 0; }[/CODE] thank you very much.. | |
Guys, I got a problem in File Handling.. I entered two words(My World)to be saved in a file but the file displays the first word only. Can you guys help me.... | |
Hi i am trying to get the values from a comma separated .dat file into an array in C. The values in the .dat file only consists of 1 and -1. I have been trying for hours now, so i decided to ask for help. Here is an example from … | |
I have a doubt regarding [B]stack[/B] in c functions... Here is a program which shows an example... [CODE] #include<stdio.h> int display(); main() { int m=display(); printf("m is : %d\n",m); } int display() { printf("1234\n"); return; } [/CODE] outputs: 1234 m is : 5 [CODE] #include<stdio.h> int display(); main() { int … | |
hey I am having confusion in the output of a simple program. here is the code:- [CODE] int main(void) { printf("%d %d",sizeof('A'),sizeof("A")); return 0; } [/CODE] output on my compiler(gcc):- 4 2. I thought sizeof("A") is considered as string ending with '\0' so there are two characters i.e,2 bytes a … | |
Hi can you pls help me how this program containing a function that accepts a 5-digit numbers & returns the digit in reverse. like: Enter 5-digit number: 13569 Reversed: 96531 thankyou ;) | |
hey guys, new to daniweb here. This is my first assignment in my first C class at school. I'm having some trouble getting the program to work, was wondering if you folks could give me some tips. I believe I have most of the code down, I think my issue … | |
I am having trouble with making my program read in binary and convert it into an integer so that I can do arithmetic on it, and then output it back out as binary. Here is my code. The first part of it works, and I can read in the 2 … | |
I'm new here so please don't be rude. Okay, my problem is I don't know the exact code on how you print in reverse in array. Here's the problem: Write a program to input a set of five numbers and print them out n the reverse order of input. Put … | |
i found a very simple program that is very simple but have a great logic. [CODE] #include<stdio.h> #include<conio.h> void main() { int B=1; printf("%d\n%d\n%d",b=15,b>9,b<9); getch(); } [/CODE] this seems very simple to me but the output is very strange to me OUTPUT:- 15 0 1 I tried very much to … | |
i am confused that when to use '&' sign in arrays. some times in string array or in character array i got confused. bcz array name itself is an address .so an1 can plz help me out of this?? | |
This program is driving me crazy. I'm relatively new to programming and I can't figure out how to fix the error in the title (line 50). I'd really appreciate any help. [code=c] #include <stdio.h> #include <string.h> #include <stdlib.h> #define SIZE 20 //constants defined before main #define MAX_LEN 30 double calchours(int … | |
Please help me. Can you guys tell me how to put a background color in C. | |
hello daniweb, I am new to C Programming,can anyone explain me the functionality and uses of getline(),with advantages and its disadvantages and where to use? thanks in advance | |
Hii my question is how do we decide when to use which type of datatype For eg in some program we get int i, whereas in some programs it is float i, whereas in other programs it is double i....so how do we know which datatype to use...I am confused … | |
Hi, thank you for taking the time to take a look at this. So here's the deal, my assignment is to write a program that resembles the traditional version of bc. It will translate the more common way of writing arithmetic expressions into postfix form used by the dc utility. … | |
Hello all. I'm having problems figuring out how to get atof working in my program. I'm not sure exactly what I'm missing, and I was hoping someone could point me in the right direction. Thanks. [CODE]#include <math.h> #include <stdlib.h> #include <ctype.h> #include <stdio.h> static int top = -1; static double … | |
| Hello! I am trying to make a mimic code of LS command in C. It is compiled with gcc in ubuntu, and I have some questions to ask. I have used opendir to open current directory, and then i read each directory using while loop to print all the directories … |
The End.