15,548 Topics

Member Avatar for
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
361
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
75
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
107
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
53
Member Avatar for rQQt

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
92
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
102
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
71
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
484
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
137
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
238
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
124
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 iamthwee
0
126
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
315
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
26
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
234
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
69
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 iamthwee
0
92
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
121
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
255
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
127
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
198
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
97
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
86
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 nicentral
0
82
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
97
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
111
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
75
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 GreenDay2001

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
103

The End.