19,876 Topics

Member Avatar for
Member Avatar for sucram

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 …

Member Avatar for Narue
0
160
Member Avatar for ico303

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 …

0
65
Member Avatar for vijayca

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 …

0
122
Member Avatar for Nikhar

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 …

Member Avatar for Nikhar
0
236
Member Avatar for J_17

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?

Member Avatar for D.M.
0
71
Member Avatar for haanjae

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

Member Avatar for Mitja Bonca
0
2K
Member Avatar for ganil_22

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

Member Avatar for skatamatic
0
112
Member Avatar for jackc121

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 …

Member Avatar for jackc121
0
172
Member Avatar for Aman6o

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

Member Avatar for N1GHTS
0
93
Member Avatar for tayler

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

Member Avatar for N1GHTS
0
133
Member Avatar for J_17

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]

Member Avatar for gerard4143
0
92
Member Avatar for robdb

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 …

Member Avatar for raptr_dflo
0
534
Member Avatar for dgreene1210

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

Member Avatar for gerard4143
0
171
Member Avatar for untio

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 …

Member Avatar for N1GHTS
0
188
Member Avatar for soundar

1.what Is The Difference Between Procedure Oriented Language And Object Oriented Language? 2.what Are The Drawbacks Of Procedure Oriented Language?

Member Avatar for N1GHTS
0
120
Member Avatar for priyad2

please help me with the code behind file..as i am really confused...otherwise give me some tips to start doing the code

Member Avatar for Zvjezdan23
3
4K
Member Avatar for Zvjezdan23

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

Member Avatar for Zvjezdan23
0
129
Member Avatar for techlawsam

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

Member Avatar for nick.crane
0
244
Member Avatar for asitmahato

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

Member Avatar for L7Sqr
0
2K
Member Avatar for gerard4143

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 …

Member Avatar for Ketsuekiame
0
262
Member Avatar for D.M.

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

Member Avatar for abhishek25
0
123
Member Avatar for robdb

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

Member Avatar for robdb
0
2K
Member Avatar for toebs

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 …

Member Avatar for toebs
0
239
Member Avatar for kittu.kishore

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 …

Member Avatar for N1GHTS
0
223
Member Avatar for cse.avinash

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 …

Member Avatar for gerard4143
0
97
Member Avatar for chezkaty

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 ;)

Member Avatar for Narue
0
159
Member Avatar for jonkim9483

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 …

Member Avatar for D.M.
0
373
Member Avatar for khsoccer

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 …

Member Avatar for D33wakar
0
257
Member Avatar for Jared1337

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 …

Member Avatar for Jared1337
0
150
Member Avatar for jigglymig

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

Member Avatar for jigglymig
0
239
Member Avatar for robdb

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 …

Member Avatar for robdb
0
378
Member Avatar for hdan

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 …

Member Avatar for chochang262
0
901
Member Avatar for Tenjune

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 …

Member Avatar for Narue
0
98
Member Avatar for hackit

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 …

Member Avatar for Narue
0
154
Member Avatar for devanshee

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

Member Avatar for Narue
0
2K
Member Avatar for UrbanBourbon

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 …

Member Avatar for Narue
0
2K
Member Avatar for meli123

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

Member Avatar for murnesty
0
211
Member Avatar for D.M.
Member Avatar for ashok1514
0
651
Member Avatar for geeksforgeek

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

Member Avatar for D.M.
0
144
Member Avatar for kylelendo

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 …

Member Avatar for D.M.
0
107
Member Avatar for sheepdogg09

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

Member Avatar for nezachem
0
115
Member Avatar for NV43

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 …

Member Avatar for NV43
0
100
Member Avatar for Eonimal

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 …

Member Avatar for Eonimal
0
231
Member Avatar for Freude

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

Member Avatar for Freude
0
86
Member Avatar for dellat

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 …

Member Avatar for dellat
0
175
Member Avatar for shaunchu

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 …

Member Avatar for cse.avinash
0
114
Member Avatar for N1GHTS

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 …

Member Avatar for N1GHTS
0
152
Member Avatar for Rupindersingh

What is EOF. How is it generated? Which key corresponds to "end of file" on the keybord??

Member Avatar for Rupindersingh
0
121
Member Avatar for Rupindersingh

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 …

Member Avatar for Narue
0
246
Member Avatar for apanimesh061

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

0
68

The End.