19,876 Topics
![]() | |
I am new in c programing.In apps they usualy have images as background take for example a question and answer app will have a colourful backgroung.If i draw an image with corel draw how can i display as background in my c program. | |
is there any alternative for wavread (in matlab) in c. i want to get the samples, sampling frequency and bits per sample??? | |
and my code to write into a file is ofstream file; file.open("CustomerFile.txt",ios::app); file.write((char *) & customer,sizeof Customer); file.close(); file.open("AccountFile.txt",ios::app); file.write((char *)& account,sizeof Account); file.close(); can someone figure out my mistakes. Thanks in advance | |
hello, I'm new to c and i need to put the following string from a file into a linked list : music;artist;1,2,3,4;2015 i also need to put "1,2,3,4" in an array but only the numbers. I would really appreciate your help. Thank you ![]() | |
I'm trying to load a png to my button, but it's not showing the png in my button. I create my button with this function: HWND MyControls::CreateButton(LPCTSTR text, int x, int y, int w, int h, HMENU id, HWND hwnd, HINSTANCE hInst, bool png){ if (png){ return CreateWindow("BUTTON", text, BS_BITMAP … | |
fstream file; file.open("PasswordGenFile.dat",ios::out); In writing into a .dat file what does the following line mean? file.write((char *) this, sizeof(PasswordGenerator)); And how can i convert this bit of code if i want to write it into a .txt file? | |
In the following program it says that there is a conflict between my getline and the getline in stdio.h. I understand what it's saying because stdio.h has it's own getline function. What's confusing me is that this is the program that my programming book (The C Programming Language) is giving … | |
If you are a programmer than you probably know or at least know of C++ well now a company called Digital Mars is developing the D programming lanugage. [I] "D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with … | |
i need to make a c++ console based program for a banking system using files. i implemented some code but having difficulty with withdrawing money from the account, checking balance, transferring funds and viewing transaction. For withdrawing funds i implemented the following code but it doesn't seem to work properly. … | |
![]() | //compiled with cmd command:gcc main.c -std=c11 -o main.exe //this is only file #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <string.h> //user changeable variables int boardSize = 9;//board hight and width are of equal size #define NUMBER_OF_GRID_CHOICES 7//this has to be an odd number(increase it by two if you add another … |
How to solve this problem? I'm getting tired thinking abou this. Help me. Write a C++ program to help the master reporter of a traffic centre to analyse the amount of traffic coming from all the different entry points to a city. The amount of traffic for each entry point … | |
I've been having a hard time for quite a while now trying to read files. These files include English text, pictures music and so on. After hurting in the jungles of Africa or the internet I found something that worked. `string str((istreambuf_iterator<char>(fileIn)), istreambuf_iterator<char>());` This made it possible to do all … | |
it is a simple program but the beuty lies in its shortness it is written in least line as possible By :- Anurag Pareek | |
i have programe in c but i need to use function and i have no idea how do it can any one help me please and one more thing i cant use loop inside case so it must be out #include<stdio.h> #include<stdlib.h> int main() { int row ,n,c,temp,k,count=1; int input … | |
Hi All, I am very new to C Programming. I am writing a C Program to run in an UNIX machine which is used to Archive Log files if it exceeds a particular Size. The thing is the program has to get the details of the file like file name, … | |
Can someone please tell me why when I check one of my boxes, and click the button I get no message box in accordance to which checkbox I checked. #include <windows.h> #include <dos.h> #include <stdlib.h> #include <fstream> using namespace std; #define IDC_MAIN_BUTTON 101 // Button identifier #define IDC_MAIN_EDIT 102 // … | |
hii I have a list having m1 m2 m3........ m922 and in each there are a1 a2 a3 a4 are there like m1=a1 a2 a3 a4 a5 a6 m2=a1 a2 a3 a4 a5 a6 m3=a1 a3 a5 a7 a8 a2 etc and i want this as m1=a1 a2 a3 a4 … | |
Hello, I posted on this forum two times before about a particular pair of non-printing characters being inserted into my code. You can find the threads [here](https://www.daniweb.com/software-development/threads/441611/stray-non-printing-characters-in-my-programs) and [here](https://www.daniweb.com/software-development/cpp/threads/450296/arbitrarily-appearing-non-printing-character). Two great posters tried their best to solve this problem (mike_2000_17 and deceptikon) to no avail. Finally, using the hints that … | |
I want to get the occurence of the symbol ';' for each line of this C program. I type the name of the file Source.c and try to count the occuring symbol, but i am getting the value for ALL of the ';' for each line. #include <stdio.h> #include <stdlib.h> … | |
Hi, This two parts of code both are intended to do one thing. get two numbers from user, calculate sum between them. print it. now only the first code is working properly. second one is faulty. but why? what's the problem? code no1: #include <stdio.h> int main() { int n, … | |
In my opinion, that code is not true. because of in the 15 line. I assume that, when a==i --> a%i==0 --> break; --> line 16 will be never executed! please make me clearly ! | |
Hello Everyone. I'm basically new to c# database project so any can give me code as to pass a data value from one datagrid table to other form with another data grid view table . also i wanted to know as how to get specific value of a row when … | |
Sample output: Please enter a number(Less than 8 digits): 1203021 how can I sure only 8 digits key in and how to count the zero inside the given number. Please teach me final is coming :( | |
Hi, I wrote the following program: #include <stdio.h> #include <stdlib.h> #define TRUE = 1; #define FALSE = 0; static int *arr; static int size=0; void createSet() { arr= (int *)malloc(sizeof(int)); size=0; }/*createSet function*/ void putInSet(int num) { int *temp; size++; temp=(int *)realloc(arr,size*sizeof(int)); if(temp!=NULL) { arr=temp; } else { printf("Insufficient amount … | |
please help!!!!! I wrote this program to calculate addtition and subtraction of two large numbers (maximum 100 digit) it won't work for minus numbers :( i know it have problems but i couldn't fix them,please help me for fixing this :) #include <stdio.h> #include <stdlib.h> int main() { int i,d=0,la,lb,max,ia,ib,ix,iy; … | |
Hello friends, I am trying to work on a project that dynamically allocates memory when needed for a string array. I just keep getting memory faults when reallocating memory but can't find any thourough tutorials on realloc besides the man page. So basically, I malloc 201 character spaces in an … | |
Hi, I am a newby and am surprised I made it this far. My program is a TicTacToe program. I am having troubles with checking the validity of each move. I have tried multiple things, but could not figure it out. If someone could help point me in the right … | |
hey , i'm having a problem with a LINK error i keep getting the same error although deleted the line with the flushall_ also i copyed the code in a new project but it still gives me the same error the error : Error 1 error LNK2019: unresolved external symbol … | |
Input a string and check whether a particular character is present in it | |
This program goes against everything I have been taught and learned in C. How does this compile? Why does this not need to be int main? Why no return 0? Don't you need an initial declaration of sub() above main? That bugs the crap out of me. I like keeping … | |
Hi. am starting out with network programming and unix network programming book. all its trying to do is connect to server and read time, but when i run it it says : 'connect error: Connection refused' Here's the code : #include "unp.h" int main(int argc, char **argv) { int sockfd, … | |
Hello, Can someone, please, comment on the following curious fact that I encountered in C (actually, I use gcc, which has the default language Gnu C): If one writes const int a=10; const int b=a; one gets an error indication at the declaration of b (not constant!). I would be … | |
[CODE]//--------------------------------------------------------------------------- #include <windows.h> #include <CommCtrl.h> // needed for adding custom toolbar #include "resource.h" #pragma hdrstop //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- LPCTSTR ClsName = L"FundApp"; //LPCTSTR WndName = L"Resources Fundamentals"; const int NUMBUTTONS = 3; TCHAR AppCaption[40]; LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); //--------------------------------------------------------------------------- INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, … | |
**Construct a binary tree using the following pre - order and in - order trasversals : Pre-order:ABGHMCDEF In-order:BHMGADFEC ** I Just Need a Diagram of Binary Tree . I have tried a lot with youtube tutorials but not getting the answer plz help. | |
How to calculate big O, omega and theta of any algorithm? | |
hi i'm having trouble in sorting the text file in inorder traversal can anyone help me out? code: #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> struct TreeNode; typedef struct TreeNode *node; typedef char ElementType; struct TreeNode{ char element; node left, right; } *root; node insert(ElementType x,node t){ … | |
i did 1 code for give me the menu position. but i'm getting problems compare the LPSTR or LPCSTR with string :( int GetMenuPosition(HMENU menu, string caption) { int i=0; for(i=0; i<GetMenuItemCount(menu)-1;i++) { MENUITEMINFO s= {0}; s.cbSize=sizeof(MENUITEMINFO ); s.fMask=MIIM_STRING; s.cch=strlen(strCaption.c_str()); //s.dwTypeData=(LPSTR)strCaption.c_str(); GetMenuItemInfo (menu,i, true, &s); string b=static_cast<char*>(s.dwTypeData); if(b==caption) break; } … | |
I want start on driver development, but I am not getting any beginer tutorial or book, where I can some sample app. If any body have any good resource kindly share.. Thanks in advance. | |
I am working on a little project of mine. Nothing major, just messing around with encryption etc... I have problem thoug. My methods do not change the values of my data. Meaning that the pointer that I pass to hold my encrypted data, doesn't get the data assigned to its … | |
Hello All, I am just a newbie trying to explore areas into game developement using .Net (may be XNA studio) though I am not familier with the same. Could you please suggest some tutorials, ebooks for this so that I can start as a beginner and then later on, may … | |
hi i'm writting a program by lex and yacc. i want to add some invariants in some special of an input file. my expected output is the same input file while some invaraints are place through statements.how can i do it? i can transfor the input file to output in … | |
I need a help , to make this code to sort data from text file.Any help is appreciated! file: 50 72 10 30 90 4 23 #include<iostream> #include<conio.h> void mergesort(int[],int,int); void merge(int[],int,int,int); void main() { int a[20],p,q,r,i,n; cout<<"Enter the number of elements"; cin>>n; p=0; r=n-1; cout<<"Enter the array"; for(i=0;i<n;i++) { … | |
hello i had trouble in finding out whats wrong with my code I want to sort the data's from my text file and it somehow did but some of the words did not appear. word.txt hello apple hi banana mango the output I get is : hello hello hi hi … | |
I recently read about the Ackerman Function and thought I would do my own implementation of it: #include <stdio.h> long long int ackermann(long long int m, long long int n) { if (m == 0) return n + 1; if (n == 0) return ackermann(m - 1, 1); return ackermann(m … | |
I'm trying to code a program that categorized a series to be one of the following for example: 1. "demo" ; "abc" - are both hard ascending series. 2. "aabc" ; "aa" ; "zz" - are an ascending series. 3. "zzabcd" - is a non-ordered series. I wrote the following: … | |
hello... I am trying to convert 2 digit numbers to words: example 11= eleven. I saw some other entries on this but they dont include case or switch so far I have: [code=cplusplus] #include <iostream> using namespace std; cout<<"Enter a two-digit number: "; cin>>number; if(number>99) { cout<<"Number out of range"; … | |
I'm trying to sort a deck with merge sort.I have all my code working except merge sort function . Any help would be really helpful ;) int temp; int br = 1; void push_l(int n); void push_r(int n); int pop_l(int &n); int pop_r(int &n); struct elem { int key; elem … | |
hi i am tryin to create an academic schedule were i would enter some data to create it. The algorithm has to have a basic structure were i can put the names of the proffesor, the names of the subjects and some other information. If you can tell me how … |
The End.