18,491 Topics

Member Avatar for
Member Avatar for whitemoss

Hi all, I try to compile my program and got this kind of error: test6.c: In function `main': test6.c:46: too many arguments to function `mysql_query' Here is my code: [CODE] int main(int argc, char *argv[]) { char string1[1600], string2[1600], query[1600], mobileno[50]; int i, j, len; FILE *fp2; mysql_init(&conn); /* Connect …

Member Avatar for whitemoss
0
1K
Member Avatar for nirmala.s

Hi folkz, Need help in writing a C program..The scenario is as follows: We need to copy a log file frm the database to a txt file and the txt file should automatically get updated whenever the log file is modified... Also there shld be a facility to filter data …

Member Avatar for Ancient Dragon
0
139
Member Avatar for NSta

Hi i am so lost and stressed please can some help me. My question is how do i code the follwoing • Constructor: Copy The copy constructor should check the validity of the Entry object parameter through the use of the isValid method and copy the valid objects media and …

Member Avatar for NSta
0
155
Member Avatar for Plymouth

Hello there. I found this site whilst looking for info on the internet regarding the difference between getch() and getche(). Looks like it's potentially a [U]very[/U] good site for programming related info :) I'm a programming newbie, who has just learnt how to use the GNU compiler collection, and am …

Member Avatar for happygeek
0
56
Member Avatar for d1e9v85

i am having trouble iwth this question i am a little weak with classes that is why i cant complete this any help would be greatly appreciated Create a class for airline reservation. Assume that there are two aircraft models A, B. The class has following constants defined, const int …

Member Avatar for ~s.o.s~
0
216
Member Avatar for Monsignor

I'm not sure if my title makes sense. My problem is the following: I input a string and the function in my program is supposed to change every digit (except for 0) it finds in the string to a value -1 of that digit (eg 'er345ut' should be changed to …

Member Avatar for the_count
0
192
Member Avatar for Firestone

I keep looking at this code, and cant find out the problem... I made this as part of a library of math functions. It asks the user to enter the number of numbers to subtract, then enter them. It should work, but for some reason doesn't. [code] void sub() { …

Member Avatar for ~s.o.s~
0
118
Member Avatar for yashamaru2006

Hi, Can anyone help me read the code below? I have an idea but i am not quite sure. [code] *(DWORD*)(pDesPtr+(nDesIndex>>3)) |= pSrc[nCount] << (nDesIndex&7); [/code] thanks a lot,

Member Avatar for yashamaru2006
0
103
Member Avatar for sgriffiths

Hello all I want to split regular expression values in the list (in quotes) list("A","B"....... ) What is the best way to go about this? Regards

Member Avatar for ~s.o.s~
0
120
Member Avatar for Line

Hey! Writing a simple client/server in C and I'm currently stuck with getting the results after calling system("ls") so I can send it from server to client. Since system() returns an int I tried popen() --> [CODE] char buffer[1000]; FILE* myPipe = popen(buf, "r"); if(myPipe==NULL){ //errorstuff } while(fgets(buffer, 1000, myPipe)!=NULL){ …

Member Avatar for Ancient Dragon
0
126
Member Avatar for kipl20

hi i need to write a while loop to print out groups of stars shown in the attachment the middle set?? cud someone provide me with an answer please as i am desperate to get it working. thanks in advance

Member Avatar for ~s.o.s~
0
134
Member Avatar for Acquire

Hi guys, I'm making a program tha thas to open a file, and then store the information from the file into a structure variable, only I can't get the function to work. I can get the program to work if I put the reading of the file in the main …

Member Avatar for Lerner
0
124
Member Avatar for Sin-da-cat

OK, so the part of my course about files is over, but now I am wondering: if you have a file with, say, a bunch of names (each in its own line), is it possible to use "C" to make a new file with the names aranged alphabetically? For example, …

Member Avatar for vegaseat
0
438
Member Avatar for nanodano

Does anyone know where I can find the pthread library for Linux? And I don't want any rude "go google it" responds. I tried that, and all I came up with was one download available for win32.

Member Avatar for nanodano
0
97
Member Avatar for harish13

[I]hi,[/I] [I] have a exe file (developed in C) I want to call this exe from VB at the same time i want to pass a file name as parameter to that exe file .Please help me in this regard thank u in advance[/I]

Member Avatar for Marikanna
0
99
Member Avatar for sameer.mastek

I am working on eSNACC 1.7 and VC++. I want to convert the ASN.1 to noraml c++ data type and vice versa. Right now I have generated code and created the dll for the C++ files generated from ASN.1 module. But the issue is with using this dll to encode …

0
72
Member Avatar for Firestone

I cant get my function code to work. Its should return an average of however many numbers are entered, but it always returns 775863 no matte what... can anyone tell me whats wrong? [code] #include <stdio.h> int avg(int av[], int y, int x, int z); int main(){ int x=0; int …

Member Avatar for Ancient Dragon
0
121
Member Avatar for rxgmoral

about VC+MySQL problem:) i install mysql odbc V5.0 driver i need to ADO Connect MYSQL DB; code: _ConnectionPtr m_CMConnect; ::CoInitialize(NULL); m_CMConnect.CreateInstance(__uuidof(Connection)); m_CMConnect->Open("Provider=MySQL;server=localhost;DataBase=test;port=3306;uid=root;pwd=","","",-1); but Program run error..... how to Ado Connect MYSQL DB; thank:)

0
66
Member Avatar for Member #126838

Hello I'm writing a little selection sort program in C. Unfortunately the algorithm doesn't work correctly. After the selection sort some float numbers in the array are rounded down to whole ints. Here's the example: [inlinecode] Code: enter input filename:data // input numbers 5.000000 7.000000 -48.400000 8.800000 8.400000 1.500000 8.400000 …

Member Avatar for Salem
0
111
Member Avatar for Acquire

Ok, I'm doing a basic structure program that displays things. Here's an example of what it should display. [code]Invalid data in line 11 Daring Dunkers Player Statistics Player Field Goals Free Throws Total Tried Made % Tried Made % Points Jerry 2 1 0.50 2 1 0.50 3 Akeem 0 …

Member Avatar for WaltP
0
127
Member Avatar for JRM

I have a funtion executing a loop, which semes to be progressing normally until the debugger halted with this message; Program received signal SIGSEGV, Segmentation fault. I pulled up a a backtrace and it had "normal lookuing" addresses for the this pointer and the reference variable. I could probably figure …

Member Avatar for Ancient Dragon
0
90
Member Avatar for Acquire

I'm trying to make a loop that that will skip a number but has a certain limit to how high it goes... For example: I have a for loop: [code]for (i = 0; i < count; i++ ) { stuff }[/code] but lets say I want to skip a number …

Member Avatar for Acquire
0
525
Member Avatar for stupidenator

Hi everyone, I have a small problem. I am writing a program for school in which I will construct a hash table for dictionary words, using the soundex code of the word as the hash function. For the hash function, I have to take the soundex code and convert it …

Member Avatar for stupidenator
0
160
Member Avatar for Acquire

I'm fairly new to C and have been doing pretty good up until arrays. I understand the basics of them but not exactly how to use and impliment them in more complicated ways. I am trying to write a program that will display a table of strings and intigers from …

Member Avatar for majicbeans
0
264
Member Avatar for majicbeans

[CODE=c] #include<stdio.h> int main(void) { char letter; char *pletter; pletter = &letter; printf("%p", &letter; putchar('\t'); printf("%p", letter); putchar('\n'); puts("Understand?\nWhat is the right way? it is 4bytes different"); //*allows the value to be altered by the base adderess //&lets a datatype to value by its adderess from another datatype takes 2 …

Member Avatar for majicbeans
0
147
Member Avatar for swathi.s

hey ppl, for a project in coll i need to implement a simple lexical analyser in C....i did get a code but wen implemented it recognises EOF after one blank line...as d input n ouput are files...so if any idea as wat could be d reason??? n any codes to …

Member Avatar for Member #46692
0
145
Member Avatar for boujibabe

I working on a program that summerizes text documents and I need a way to find the length of the longest and shortest lines in the file and display it in a log file. I've already done a character count and line count. Also say I wanted to created different …

Member Avatar for boujibabe
0
378
Member Avatar for varsha5in

[B]hello guys, I have to implement multilevel paging in c. It has to read a text file which has 32 bit addresses. It has to divide it into level 0,1,2. Decide number of bits for all these levels. Then implement it in the way multilevel pagetables are implemented. This one …

Member Avatar for ~s.o.s~
0
34
Member Avatar for aznballerlee

[code] #define _CRT_SECURE_NO_DEPRECATE #include <iostream> #include <fstream> #include <cstring> #include <cctype> #include <cstdlib> #include <ctime> using namespace std; const int MAXWORDS = 8000; const int MAXWORDLENGTH = 6; const int MINWORDLENGTH = 4; int nWords; void fillWords(char words[][MAXWORDLENGTH + 1], int maxwords, int& num); int playOneRound (int wordnum); void correct …

Member Avatar for ~s.o.s~
0
153
Member Avatar for Eddy Dean

Hello, I want to be able to read the memory of a process in Linux. After some googling I've read that ptrace can be used to this. The syntax of ptrace is as follows: [code]int ptrace(int request, pid_t pid, int addr, int data);[/code] The first value (int request) is what …

Member Avatar for ~s.o.s~
0
379
Member Avatar for hkBattousai

Hello, I want to create a WebBrowser control in my Win32 project using DevCPP. I had a search in MSDN. Creating a WebBrowser control looks like far different than creating a button or edit control. I have no idea what code should I write. Any answer will be apreciated.

Member Avatar for Ancient Dragon
0
80
Member Avatar for nasduck

Hello, there: I am trying to calculate to the inverse of matrix A. How to call function to main part? How to write the code for a matrix? Can someone help me modify the errors? Thank you very much! -------- [code=c] #include "matrix.h" Matrix solve(const Matrix& A, const Matrix& B){ …

Member Avatar for Member #46692
0
112
Member Avatar for spacecowboy123

Hi All, I'm having a problem with a friend function I am using. The darn thing just won't compile! It goes something like this [code] class G { protected: public: void reduce(H& Cost); }; void G::reduce(H& Cost) { Cost = Cost * 0.95; } [/code] and later [code] Class H …

Member Avatar for Ancient Dragon
0
130
Member Avatar for kie

Hey all Basically, I am trying to get my head around data validation. I am very new to C, in fact I have only been doing it a few days. I am trying to make a simple currency converter that validates that the data is numerical. Alos, I would like …

Member Avatar for WaltP
0
293
Member Avatar for TylerSBreton

This block of code will compile, but gives me a runtime error: before the first comment is a header that is included in the file that you may need to analyze my code. [code= c] typedef char *string; typedef struct { string fieldName; string value; }oneField; /* this starts the …

Member Avatar for TylerSBreton
0
5K
Member Avatar for atrusmre

Say I have an edit box in a MFC application (let's call it IDC_EDITBOX), and I enable (because I have it greyed out by default)it using [code=c]GetDlgItem(IDC_EDITBOX)->EnableWindow(TRUE)[/code] How do I set the focus to that control? In other words, when I enable the control, how can I get the cursor …

Member Avatar for atrusmre
0
178
Member Avatar for Sin-da-cat

I'm pretty much new to using files, so I'm not sure if this is a banale question. Here's the assignment: "[I]Each line of the file dec.txt contains a whole number (>0). Write a program that creates a file called hex.txt. Each line of this file is to contain a string …

Member Avatar for Sin-da-cat
0
254
Member Avatar for batista06

Hey, while doing an assignment I came across a code. however, when I run it I get no output. would like to know why if anyone knows..... [code] #include <stdlib.h> #include <stdio.h> int main(int ac, char** av) { unsigned register int j,sum,dcnt, limit; unsigned int number,max; if (ac != 2) …

Member Avatar for batista06
0
129
Member Avatar for Prahaai

Hello. I have this problem: I have a let's say [1000] char string and i want to split and print this on the screen on more lines, so that each and every line has MAXIM 43 characters. The string may contain spaces and the words would be printed on the …

Member Avatar for Prahaai
0
116
Member Avatar for s88

the problem is that, the function is only replacing the number that I want to delete with th number after it, but everything remains the same after. e.g. it is showing me 1 2 3 5 5 6 7 8 9 10 [code] #include <stdio.h> int rem(int a[],int pLen,int pos) …

Member Avatar for Member #33065
0
112
Member Avatar for dev.cplusplus

Hi, I have two questions: 1. I receive a project and I noticed that when I want to compile I have the following options: Debug Release Release MinDependecy Release MinSize I know only Debug and Release, what are the other options? What are the meaning when compiling with this options? …

Member Avatar for Ancient Dragon
0
113
Member Avatar for siddhiinfomedia

Hello Friends... I've written a code for Simulating Paging algorithm using LRU... The code is in the attached file. Now on windows... it is executing perfectly, giving the output i desire... but on Linux REGAL gnu compiler, it is giving me the error... Error file is attached... as error2.jpg SEGMENTATION …

Member Avatar for Ancient Dragon
0
137
Member Avatar for aznballerlee

I'm having a hard time generating a "secret word" that is random. I'm taking a random word from the wordList array, and using it in the playOneRound function. Here is part of my instructions: [code] Using wordList[wordnum] as the secret word, this function plays one round of the game. It …

Member Avatar for aznballerlee
0
181
Member Avatar for webspy

I'm working on a plugin system for my application. The plugins are in the form of a dll loaded by my application using [inlinecode]LoadLibraryEx[/inlinecode]. I store information about each plugin in an arrray of structs: [code] typedef struct _InternalPluginInfo { UINT ID; HMODULE Module; int Flags; PluginInfo Info; } InternalPluginInfo; …

Member Avatar for webspy
0
165
Member Avatar for arbid123

I am calling C function from MATLAB using mex-files. The C function has a few static variables. I want to remove the static variables from the memory between consecitive calls to the C function. It is possible to do that without manually making all the variables in the C function …

Member Avatar for b4codes
0
84
Member Avatar for atrusmre

I am writing a MFC application and need to have the program pause for a few seconds. I am trying to use the OnTimer event and am having troubles. The following code causes the program to freeze and stop responding [code=c] m_iCount = 0; SetTimer(ID_TEST_TIMER, 1000, NULL); while(m_iCount <= 5) …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for fsemilla

im fsemilla a college stud in UC of Cebu, Phils... i'm not an experienced programmer...but i have a little knowledge in C and somehow, a little with C++, Java, and assembly... I'm a newbie trying to put my hands on bluetooth programming as part of our training and to satisfy …

Member Avatar for happygeek
0
50
Member Avatar for Member #114696

here's a piece of window procedure. What does DefWindowProc do in this program. [code] LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_DESTROY: // user wants to exit PostQuitMessage(WM_QUIT); break; default: // Hand off unprocessed messages to DefWindowProc return [B]DefWindowProc(hWnd, Msg, wParam, lParam)[/B]; } …

Member Avatar for Ancient Dragon
0
132
Member Avatar for dev.cplusplus

Hi I to all I have the following question, I hope you can help me: I need to store variables, in diferent variable types, but I want to know for example the size of the int type what size of number I can store, I found that int can store …

Member Avatar for jbennet
0
101
Member Avatar for chunkmartinez

Whats an easy way could i display an image in a win32 program? (bitmap,gif,whatever)

Member Avatar for chunkmartinez
0
111

The End.