19,876 Topics

Member Avatar for
Member Avatar for seul

Hello, i want to make a multiline listbox, that would look like [URL="http://www.daniweb.com/forums/attachment.php?attachmentid=13350&stc=1&d=1264164137"]this[/URL]. I was searching for solution for a week so i think now is the time to ask for help :( As you see this listbox is so special, because it has two lines per row and those …

Member Avatar for Protuberance
0
198
Member Avatar for Gaiety

Is there any problem with the code . Why this code is generating all offsets as 28. [CODE] #include<stdlib.h> #define offsetof( T , M ) (( size_t )(( char *)&(( T *)0) ->r - \ (char *)(T *) 0)) int main(void) { struct STU { char name[20]; struct DATE { …

Member Avatar for Gaiety
0
100
Member Avatar for adcodingmaster
Member Avatar for jonsca
1
124
Member Avatar for speakvair

wn compile a code(400 lines app) after running 3 times through the loop(loop in the sense assume the 200 lines) it says unable to open a file...(which it had opened d previous 3 times and executed wel) so i tried perror() and found "not enough memory" Please suggest me wt …

Member Avatar for thomas_naveen
0
162
Member Avatar for wingers1290

First off thanks to all the members of daniweb for all there help and support, they've been fantastic. I'm on the last stage of my program and i need a little more help. I am using binary serialization to save information, i don't want to use xml because frankly it …

Member Avatar for wingers1290
0
172
Member Avatar for AAAKsu

Hi! Can anyone explain why the output of the code below is [B]6 7 7[/B] ? [CODE]#include <stdio.h> int main () { int a=5; printf ("%d%d%d",a++,a,++a); return 0; }[/CODE]

Member Avatar for Salem
0
67
Member Avatar for eliza2044

Hey guys, I'm working on an SQLite3 wrapper using C programming. I was wondering if you know how can I set database properties such as mode, headers and echo through the C application. For example when running the SQLite shell and you are connected to the database you can do …

Member Avatar for eliza2044
0
112
Member Avatar for John_W

Hey how do I make so this would save myfile as a text file? [CODE]FILE * pFile; char filename[256] = "myfile"; pFile = fopen (("%s",filename), "w"); fclose (pFile);[/CODE] This creates a File named myfile but not as a textfile. I tried to add .txt after %s but that doesn't help. …

Member Avatar for Dave Sinkula
0
130
Member Avatar for Reborn121

Hi everyone...I am building a program to input students names(first and last) and also GPA. I have everything working but the sort by last name. Everything works fine, even the GPA sort but the last name sort will not. Please help. Below is the function in my program i am …

Member Avatar for hag++
0
151
Member Avatar for Gaiety

[CODE] #include<ncurses.h> int main() { WINDOW *win ; initscr(); win = newwin(10,30,10,10); box( win, ACS_VLINE, ACS_HLINE); refresh(); wrefresh(win); mvwprintw(win , 13, 14, "Enter any Key :\n "); refresh(); wrefresh(win); getch(); refresh(); wrefresh(win); endwin(); printf("END"); return 0; } [/CODE] I just started learning Ncurses and have some questions: i understand that …

Member Avatar for Gaiety
0
152
Member Avatar for paddy8788

I want to launch a new process from a given string of input (including parameter). I tried to use system() but it appears that in the child process, getppid() is not the same as the caller in some runs (probably because system uses the shell as command interpreter). However, if …

Member Avatar for nezachem
0
241
Member Avatar for badboizEnt

i wrote this shell given below. please i need any suggestions and assistance in making this created shell support the following commands: cp (copy), del (delete), hos (prints the hostname of the machine), cd (changes directory), clr (clears the screen), dir (lists contents in directory), environ(lists the environment setting), echo …

Member Avatar for Salem
0
104
Member Avatar for prachi bhujbal

Can anyone provide me certain project topics in c/c++? i wan a sooner reply

Member Avatar for tux4life
-6
71
Member Avatar for Hawkpath

Hi, I'm just learning win32 and i wanna know: is it really necessary that i memorize all of the syntax. Is that what professionals do? Or can I just copy and paste it every time and just know what it does. Thanks, Hawkpath

Member Avatar for Rajesh R Subram
0
159
Member Avatar for johndoe444

"How to declare an array of N pointers to functions returning pointers to functions returning pointers to characters? Declare it this way char *(*(*a[N])())(); Even this seems to be correct (char*(*fun_ptr)())(*func[n])();" Is this syntax correct? If so is there any thing more confusing than this? Why do people invent something …

Member Avatar for Dave Sinkula
0
320
Member Avatar for rgpii

[CODE=c] int main(int argc, char** argv) { char c[999]; char alpha[2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','e','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; int pos[26]; int i=0; for(i=0;i<26;i++) { printf("%c\n",alpha[0][i]); } } [/CODE] This code is giving me an "error:exit code with return 1" and a lot of warning saying "excess elements in array initializer". I have kept searching the web and …

Member Avatar for gerard4143
0
2K
Member Avatar for SteveyD

Greetings again. I'm encountering an error with the following section of my script. If I include the commented section my program returns the following error; "(Router -Startup) the URL cannot be empty. Parameter name : url" With it commented out like below, the .dll functions correctly. [code] public List<Form> Startup() …

Member Avatar for SteveyD
0
818
Member Avatar for johndoe444

Hi, Where does a static function reside? We know that static variables reside in BSS. So does a static function also reside in any particular place? Again is there any classification of functions like there is for data like heap, stack, BSS. Moreover, is function pointer similar to data pointer? …

Member Avatar for gerard4143
0
1K
Member Avatar for gedas

hey guys, im working on a little program that would ask the user to input file name and would ask the user again to specify the output file so the contents of file one would be transferred in to the file 2. i have been working on it for few …

Member Avatar for gedas
0
181
Member Avatar for BoB3R

Hello, I am trying to do a program that is reading for example a.txt file that have 5 lines and i want him to show me for example line #3 only, i know i need to use fgets but i rly dont know how to start it a.txt [CODE]1;27.01.1957;8;12;31;39;43;45; 2;03.02.1957;5;10;11;22;25;27; …

Member Avatar for Dave Sinkula
0
128
Member Avatar for phil750

I have code that outputs data as so [code] Input file name: file.txt Input text: Process id 1, Quantum No 2, Priority 0 Process id 2, Quantum No 3, Priority 1 Process id 3, Quantum No 3, Priority 0 Process id 4, Quantum No 1, Priority 2 Start of processing …

0
89
Member Avatar for leeba

I want to read he source file of the .exe I am writing. For example if I am running test.exe I want to read test.c Also if the name of the file changes it still had to open it. what i have tried is: [code] FILE *fp=fopen(*.c,"r") [/code] Can someone …

Member Avatar for leeba
0
676
Member Avatar for nayef

Hi , I am in a big trouble , I am student ( electrical engineering ) in freshman year who has a course in c . I need your help in writing my project which is going to be submitted on Saturday 23 Jan and I am not familier with …

Member Avatar for jonsca
0
141
Member Avatar for tizzo233

Hi. I am trying to input values from a user and put them in a linked list. Some how when I display the values that the user inputs, they are both show up under one variable. ie. user inputs $3 and then inputs $5 for next variable. however, when i …

Member Avatar for thomas_naveen
0
109
Member Avatar for sree_ec

I am posting this for a suggestion. I want to know which is the optimized way for writing a C code for the below problem. question is to ouptut the below string "Post New Thread " to "Thread New Post" I have 2 methods. 1. Read the each character in …

Member Avatar for Ancient Dragon
0
143
Member Avatar for phil750

I have an array, b[10]; i would like to add up all the values in that array and store the answer as wt. any help?

Member Avatar for mrnutty
0
97
Member Avatar for phil750

I have an array full of ints, the program prints out a line depends on the numbr of int e.g. if int is 8 it will print the line 8 times. And do this for all the ints stored in the array. this is my output: Start of processing ---> …

0
82
Member Avatar for mayuriIT
Member Avatar for nshh

Hi, I m working in c and unix... Help me out how to become an expert in c programming.... suggest some website link, tutorials and books...for both c and unix.. Thanks, Nshh.

Member Avatar for Dave Sinkula
0
101
Member Avatar for iamminsk

[CODE]//word frequency counter #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> struct words { char word[255]; int count; struct words *next; } *pointer, *start, *previous; int statistics(); int main(void) { statistics(); system("pause"); return 0; } int statistics() { FILE *fp; int pom,a; char quest[255]; start=NULL; fp=fopen(name, "r"); fscanf(fp, "%s", &quest); …

Member Avatar for iamminsk
0
283
Member Avatar for gedas

hi guy i started learning c recently, and im trying to do exercises from the book the bad thing is they are not showing the solutions. what i need to do is simply modify the program below so that instead of reading single characters at a time, it reads in …

Member Avatar for mitrmkar
0
130
Member Avatar for javaStud

Hi, I am trying to implement a crc check but I am not having the correct output. i.e. I am having a "Corrupted file" when the file is not corrupted, and vice versa. I am not "seeing" my mistake since according to me the logic is right. The wierd thing …

Member Avatar for thomas_naveen
0
77
Member Avatar for lio180

hi all, i have i this question for my project, but i have some problems with sorting the names of students by alphabetical order and order the names by their scores. the names are strings and the scores are of type int. this is the question and i want functions …

Member Avatar for printrobin
0
115
Member Avatar for neoeinstein

I am very new to C++ and have written only basic algorithms. In school we use turbo c++ compiler but now i have to attend a workshop for which I need to be able to use a gnu compiler and I do not know how to change my programs for …

Member Avatar for neoeinstein
4
684
Member Avatar for n_angelov

Hello everybody :) I've to solve C++ problem and there it is: [B]You have to write a program in C++ that computes the difference between the maximal and the minimal value of function f(x,y) obtained on an integer point in a given rectangle [a, b] x [c, d]. Your program …

0
92
Member Avatar for ubi_ct83

hi and thanks for advance, i have a problem to compare between 2 arrays. i have a file name fruit_file which has a content like this: apple orange mango banana papaya and i have an seed array from arg list which is; mango lime pineapple peach i want to copy …

Member Avatar for thomas_naveen
0
114
Member Avatar for atticusr5

hey guys im using vi to try and compile code for school in main i keep getting errors in the functions READ and PRINT and they say that the variable in the function call is not within the scope. here is my code: [code] #include <iostream> #include <iomanip> #include <fstream> …

Member Avatar for Ancient Dragon
0
102
Member Avatar for bonzi200x

I'm implementing a TCP protocol. TCP implementation requires to send packets continuously and if the receiver doesnt respond after a particular interval of time it should resend the packet again. I need some method to implement a timer expiry function. How can I implement it?? Should i implement threads (If …

Member Avatar for bonzi200x
0
70
Member Avatar for phil750

Ok i half have a working scheduler. The idea is to print out input from a text file, with the process id quantum and priority, sort them out into priority order, 0-20(0 highest) ad print them out the number of times the quatum is. here is what i have so …

Member Avatar for phil750
0
111
Member Avatar for ContactaCall

I'm trying to get some user data into an INSERT query using the Mysql C API (don't know if this belongs rather in the Mysql forum, let me know...) I have the following code taking some pointers from the Mysql webpage forum, but to no avail: [CODE] #include <mysql.h> #include …

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

Please help, and point me in the write direction... okay so I'm basically doing a simple address book. i can create contacts and display them and search for them but... when i return to the main menu and attempt to search again... i cannot open the file... or if i …

Member Avatar for cpeister
0
220
Member Avatar for makan007

[CODE] #include <iostream> #include <cstdlib> #include <ctime> #include <cstring> using namespace std; struct UKStudent { char name [30]; int noTest; float mark [10]; int final; char grade [30]; }; struct OverseasStudent { char country [30]; char name [30]; int noTest; float mark [10]; int final; char grade [30]; }; union …

Member Avatar for Ancient Dragon
0
435
Member Avatar for zzjason

somebody help me please! Write the following C\C++ program: Program starts two threads (from now onwards A and B). Main program generates number N from range 5000 and 10000. Number N is passed to thread A. Threads A generates N random numbers from the range [1, 100]. Generated numbers are …

Member Avatar for Ancient Dragon
-3
125
Member Avatar for bhushnxx

In this assignment a scheduler algorithm needs to be designed and implemented. The scheduler designed will be used for scheduling different tasks/process to be executed in a system. There are different kinds of processes in a system. When the process enters the system it will be directly stored in the …

Member Avatar for Ancient Dragon
-5
133
Member Avatar for mas20k

give me the answer in bignners level write a program using c language to save ten numbers in an array and display them in reverse direction

Member Avatar for gerard4143
-10
55
Member Avatar for froggy1976

I have written this code and it compiles and works just fine but I would like to put the string day[7]; as private since the days of the week will never change and I am required to have at least one private member in my code. When I simply move …

Member Avatar for mitrmkar
0
129
Member Avatar for iamcreasy

This simple code is producing weird output. I write a line and press enter, it echo's the line...well, supposed to...Because, sometimes, it is not showing. In code blocks, i can assume that when the program is returning zero the program is terminating correctly. I tried to figure out, when it …

Member Avatar for xavier666
0
147
Member Avatar for baken33

i had a term project and i must do until monday . Can you help me please ? :( 1. Write a C program that plays the game of “guess the number” as follows: Your program chooses the number to be guessed by selecting an integer at random in the …

Member Avatar for Nick Evan
-3
149
Member Avatar for vaibhav2614

I am writing a C program that requires me to use a dynamically allocated struct which is defined as below. [CODE]typedef struct 513 { 514 char* word; 515 int freq; 516 }wordfreq;[/CODE] When I allocate the word field of this struct, I am allocating this dynamically as well (using strdup). …

Member Avatar for Narue
0
111
Member Avatar for tzushky

Hi, Simple but driving me nuts. I am trying to create a table of pointers to already defined structures. But I can't find correct directions and I'm not used to this so HELP pliz! I managed to do it for functions, for some reason I can't find how to do …

Member Avatar for Narue
0
185

The End.