19,876 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? | |
hi all, i have the server code and client code, but it cannot communicating with each other. i try to run it in 2 pc but happen error. i do not know what is the problem, please help me. server code: [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; … | |
Hi , I am good at C# concepts, but i am looking to gain expertise on C# programming (developing tools e.t.c) Can any of you please share some links, which contains good basic programs and projects. Thanks in advance. Regards, kumar | |
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] | |
I've created a list of strings and load a text file in it. once list is created, the program have to read it, do something and write results in a new text file. [CODE] ofstream f; f.open("filename.txt"); string key; list<string> text; static char ALPH[21] = {'A','B','C','D','E','F','G','H','I','L','M','N','O','P','Q','R','S','T','U','V','Z'}; int* index_t = new … | |
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? | |
please help me with the code behind file..as i am really confused...otherwise give me some tips to start doing the code | |
I am trying to make a simple calculator for my code and I wanted to know, how can I have the user input a number like c++ cin >> number; and then just have my math functions do the rest. I have this so far... [CODE] public static void Main() … | |
So I was looking at this problem , and in monodevelop (and Visual Studio). But for somereason I keep getting unreachable code or error in Visual Studio, I retyped and relooked over my code but I cant seem to find what the mistake is that I can run my code. … | |
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.. | |
I'm really new to C# so this may seem like a novice question..How does C# accomplished passing a reference to a object reference? I'm really trying to understand the underlying mechanisms and how it applies to the attached code with the comments - //what happens here? Do we pass a … | |
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.... | |
I have to write an application in which a text file is read and stored in a vector of strings [CODE]vector<string> text;[/CODE] After that I have to compare each character of text loaded from a file with an array of char with default content [CODE]char ARRAY[21] = {... ... ...}[/CODE] … | |
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've messed with this program for awhile, i can't figure out how to make any of the other triangular shapes beyond the first one i have. Also there's a diamond that i am supposed to make, and a triangle with spaces in the problem. Can anyone help me re-construct my … | |
need some help with the friend function that overloads the << operator heres my code thus far.... [CODE]#ifndef PRODUCT #define PRODUCT #include <iostream> using namespace std; class CProduct { private: int productID; // 5-digit product ID number int manufactureID; // 4-digit manufacturer's ID double price; // wholesale price double markup; … | |
the program must read a text file, encrypt the content and then rewrite everything to a text file. compile ok, it crashes while running and still produces an empty output. how can I fix this? vigenere.h [CODE] #include <string> using namespace std; class Vigenere{ private: string key; string text; static … | |
Hello! I want to make a trainer (just for that not because I need to cheat at a game). I have an application made by me (Untitled1.exe......ftw!) when I press any key it makes the number from x to x++... Another program I need is when I run it to … | |
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 … | |
[CODE]#include <iostream> using namespace std; int main() { char a, b, c, d, e, f, max; cout << "enter a b c: "; cin >> a >> b >> c >> d >> e >> f; max = a; if(b>max) max = b; if (c>max) max = c; if (d>max) … | |
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 … ![]() |
I am newbie in controllers' programming. Recently, reading manual about ADSP controllers, I saw the key word ".section" in the c code. In another books I saw just "section" without dot. What do these directives mean? And is there any difference between these cases? My compiler works fine with "section," … | |
Has the following code any practical utility apart from showing the working of pointers? I got it while learning c in which the tutorial showings the features of pointer. Does a C programmer use this kind of code where a int pointer has been declared first and assigned a value … | |
All right. So I'm taking an assembly language class, but we apparently also need to use a smattering of Unix and C. Our assignment is to create a function that converts from the input base to a listed base. Example of a call: ConvertToBase(057,10) should return 47 (the input was … | |
Lets say I have a shared library in Linux, written in C, with a single function that simply returns the pointer to a string literal. [code]void *ReturnObject() { return (void *)"\xFA\x03\x44\x10\xE0"; }[/code] When this library is loaded by the host application at runtime and this function is called, is the … | |
What is EOF. How is it generated? Which key corresponds to "end of file" on the keybord?? | |
Can anyone please debug the following binary tree program, it flashes two errors: 1: Type mismatch in redeclaration of 'strdup' 2: Tpe mismatch in redeclaration of 'talloc' [CODE]#include<stdio.h> #include<ctype.h> #include<string.h> #define MAXWORD 100 struct tnode *addtree(struct tnode *, char *); void treeprint(struct tnode *); struct tnode { char *word; int … | |
Here is a program to create two threads in which parent thread read the count of character in inputting string and child thread reverse the string up to that count ! [CODE] #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <pthread.h> struct pass { int c; char *arr; }; … |
The End.