19,876 Topics

Member Avatar for
Member Avatar for Peppercat101

Hi, Im new to c++ and Im struggling with something. I have a load of classes that all connect to each other. I globally overloaded the << operator for each class. So in my main I do the following: [CODE] FixedSizeMatrix y(5,5); cout<<y; cout<<y; [/CODE] The first cout works fine …

Member Avatar for mrnutty
0
128
Member Avatar for adcodingmaster

i m working on gtk but haviing a problem. i want to make a function which inputs a string and display it on a widget window and then if i call that function again by passing another string then that string should be shown forward to the previous string on …

-1
79
Member Avatar for James19142
Member Avatar for James19142
Member Avatar for James19142
Member Avatar for James19142
-1
347
Member Avatar for James19142
Member Avatar for DARK_BYTE

Hello I'm doing my OS homework and I need to know how to read an write a 32 bit integer with the write system call Here is the code that I wrote: [code] #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include<unistd.h> #include<string.h> struct Person { char name[21]; int ch_in_name; char address[21]; …

Member Avatar for gerard4143
0
4K
Member Avatar for sanushks

Hi, Below is the makeFile i tried executing on SuSe linux and getting many undefined reference errors. Anybody can shed light on this. SHELL = /bin/sh CFLAGS = -O -DSVR4 CC = /usr/bin/cc SO_LIBS = channel.so all: $(SO_LIBS) channel.so: channel_limit.o chglobals.o chinit_windup.o chprocess.o files_n_pipes.o list.o tree.o ld channel_limiting.o chglobals.o \ …

Member Avatar for sanushks
-1
129
Member Avatar for csaund1

This program kinda works, but I have one problem. I setup this program to display a message when someone enters a negative number, but I how do I set the count back to zero. Even though mesage prompts the user that a negative number is invalid, it still calculates the …

Member Avatar for Furqanz
0
177
Member Avatar for nizzy

Write a program to calculate a. Sum of diagonal elements of matrix. b. Sum of second diagonal elements of matrix

Member Avatar for tux4life
-1
74
Member Avatar for bbballin

i need help writing a program that counts the characters entered into a program untill EOF is reached. I have to use the getchar function and my program should output the number of characters entered. thanks

Member Avatar for mrnutty
-1
151
Member Avatar for kinslayer_e

Hi! I'm running Ubuntu 9.04 and using Code::Blocks as C++ IDE. I have the following code: Temp.h: [CODE]#ifndef TEMP_H_INCLUDED #define TEMP_H_INCLUDED template <typename T> class Temp { public: Temp (T d = T(0)): _dato(d) {} T getDato () const; void setDato (T d); private: T _dato; }; template class Temp<double>; …

Member Avatar for StuXYZ
0
193
Member Avatar for wyett

Alright, so I'm a bit lost as to what to do next with this and am looking for some direction. The assignment sheet is as follows: [QUOTE]CSC 265 – Fall 2009 – Program 1 Due: Thursday October 8, 10 minutes before class starts Write a header file, implementation file, and …

Member Avatar for wyett
0
2K
Member Avatar for tux4life

As the title says: a C function for detecting anagrams. Returns [B]true[/B] if both strings are anagrams, returns [B]false[/B] otherwise.

Member Avatar for Dave Sinkula
1
910
Member Avatar for bittuthegr8

is the gtk runtime library nessary to run compiled gtk apps on windows and linux ??? or is there a workaround

-1
55
Member Avatar for bittuthegr8

hi my computer fried cause of a circut overload and i really need a program to be compiled. could someone compile this for windows 32 [CODE]#include <stdio.h> #include <sys/types.h> #include <curl/curl.h> #include <curl/types.h> #include <curl/easy.h> #include <gtk/gtk.h> #include <pthread.h> #include <math.h> GtkWidget *progress_bars[999], *list_labels[999][10], *list, *list_items[999], *list_items_table[999], *list_labels_vboxes[999], *list_scrolled_window, *abort_buttons[999], …

-1
59
Member Avatar for Gaiety

The following program is working fine some times and some times getting garbages while reading contents from the files. i tried it months ago then i got the garbage results but now its working fine. but i unable to understand whats wrong with it. i have a proof when i …

Member Avatar for gerard4143
-1
181
Member Avatar for Sushma21
Member Avatar for dkalita
-1
170
Member Avatar for magicor

In my code, the parent process does not need to wait these children processes. And I need to know which child process finishes first to do rest of the code.

Member Avatar for dkalita
-1
90
Member Avatar for adcodingmaster

i m making a messenger in linux. a command line application. here is a server and 2 clients.both the clients are connected to the server but not with each other. i want to connect those 2 clients with each other. i m the server. how can i do that? plz …

Member Avatar for dkalita
-1
96
Member Avatar for MrNoob

well bascially here i started with K&R excerises with remove tabes and spaces i m not sure why my programs works in my head it does but even in puesdo code i did it does but arr[j] sometimes get intilised to values before [code] #include <stdio.h> #include <ctype.h> #define STOP …

Member Avatar for dkalita
-1
99
Member Avatar for jorge@trading

Wondering if someone can help me. I've been working on a form in VS2003 and trying to enable text boxes on that form to accept input to populate columns in an existing SQL server. I'm trying to perform the task entirely through the IDE (is it possible?), since my C# …

Member Avatar for sknake
0
102
Member Avatar for 54uydf

Hey everybody! I'm having a hard time finding a solution for my problem- I have a dynamic array that holds structs of Person type..now I want to delete one specific person so I need to move all the ppl after that person one block down in the array and then …

Member Avatar for manutm
0
113
Member Avatar for ulcimd1

I am learning about code auditing, and I have a question relating to the argc/argv[] variables. I think that the argc is an integer type, so would enough command line arguments overflow the buffer? I know that it's a stretch, but I am looking for the third vulnerability in our …

Member Avatar for Tom Gunn
0
116
Member Avatar for vladdy191

Hello I'm trying to copy a character pointer into another character pointer. I currently have [CODE]static char *my_kstrdup(const char *buf) { char *ptr, *ret; ret = ptr = kmalloc(strlen(buf)); if(ptr = NULL) panic("kmalloc returned NULL"); for(; *buf != '\0'; ++ptr, ++buf) *ptr = *buf; *ptr = '\0'; return ret; }[/CODE] …

Member Avatar for Dave Sinkula
0
74
Member Avatar for Ineedhelpplz

Why am I getting the wrong output? I have a feeling it has something to do with using type char vs. int....but im not specifically too sure. Please help! [CODE]1. blade71(130)% gcc -o vt visitype.c 2. blade71(131)% vt < vt.in > vt.out 3. blade71(132)% cat vt.out 4. The code 55 …

Member Avatar for Ineedhelpplz
0
194
Member Avatar for DARK_BYTE

I'm writing a program that needs to use only the Unix system calls open, read and write to get and print data!The problem is that the program doesn't allow me to input the marital status of the first student! Am I missing something? Here is the code: [code] #include<stdio.h> #include …

Member Avatar for DARK_BYTE
0
234
Member Avatar for acidik_4

hi Ive been working on a program that finds hidden files copies the contents and then deletes the hidden file so far ive got system("set OLDDIR=%CD%&&@ECHO OFF&&ECHO Finding Hidden Files&&dir /ah&&PAUSE"); printf("Please Choose The Files You Want To repair separated by spaces\n"); scanf("%c",&d1); getchar(); string cmd="echo"+d1; system(cmd.c_str()); but im having …

Member Avatar for MrNoob
0
74
Member Avatar for duggydiggy

[code] #include <stdio.h> #include <conio.h> void *memset(void *dest,int value,int cnt); void *memset(void *dest,int val,int cnt) { void *start=dest; while(cnt--) { *((char *)dest)++=(char)val; } return start; } int main() { char arr[]={1,2,3,4}; memset(arr,0,4); printf("%s",arr); _getch(); return 0; } [/code] error : ++ need lvalue I know how to resolve this,but I …

Member Avatar for MrNoob
0
72
Member Avatar for Comix Zone

Hi, I am new member of this forum, and i find it quite interesting. Here is my problem, i have some work for school that have to finish fast, and of course I google it, and found it here :) But there seem to be little problem, code that I've …

Member Avatar for Comix Zone
0
228
Member Avatar for Dretkal

I am getting an error that says undeclared identifier. It is on the line if (answer[i][j] == ' '){ answer[a][j] = '*'; I have attached a good chunk of the code if you need more please let me know. Thanks. int main(void) { char answer [100][48]; int count; count= GetInput(answer); …

Member Avatar for Dave Sinkula
0
76
Member Avatar for Ineedhelpplz

I receive the following error when I compile my code: [CODE]blade71(154)% gcc -o vt visitype.c Undefined first referenced symbol in file aVal /var/tmp//ccrbSM18.o ld: fatal: Symbol referencing errors. No output written to vt collect2: ld returned 1 exit status blade71(155)% cat visitype.c #include <stdio.h> #define MAX 1000 void aVal(char asciiname[], …

Member Avatar for Ineedhelpplz
0
185
Member Avatar for osei-akoto

Please can somebody explain to me whether sometimes the strrev function fails or not. I was giving an assignment to write an application that can detect whether an entered word from the keyboard is a palindrome or not. After accepting the string and tried to use the function from the …

Member Avatar for yellowSnow
0
635
Member Avatar for chingkoysilog

im not a little bit familiar with c program.....so can u help me to change this program to c program......pls ASAP.. here are the code: import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; import javax.swing.*; public class TicTacToeServer extends JFrame { private byte board[]; private boolean xMove; private JTextArea output; …

Member Avatar for yellowSnow
0
206
Member Avatar for bbballin

i have to write a program where i input two positive integers (L and H) which are both less than 21. the program then prints out a box of solid asterisks wit L horizontal asterisks and H vertical asterisks. i dont really know where to start... can someone tell me?

Member Avatar for yellowSnow
0
83
Member Avatar for sethuramang

Hello, I'm trying to implement a program in C to read and display data from a text file, assign certain values to pre-defined variables and continue reading in the data. And example format of the data file is: --------------------------------------------------------------------------------------------- *** General Comments *** .... ***... .... 5 125 3 .6167 …

Member Avatar for dkalita
0
95
Member Avatar for megha.jain08

whenever i click an update button to update values in a single column of a gridview, all the columnss gets updated with the same values. eg. if a 1st column of a row with s.no. 1 is updated with values watch,50.,,,rest of the columns of the rows with s.no.2,3,4,5 etc. …

Member Avatar for sknake
0
95
Member Avatar for adi.shoukat

[CODE]while(size!=0) { printf("loop start"); printf("File Size in int: %d \n",size); byte_count = recv(sock,recv_data, 1024,0); recv_data[byte_count] = '\0'; printf("hhahaha %d \n",10); printf("char is:%c \n",recv_data[0]); //fputc(recv_data[0], fpW); size=size-1; printf("loop end"); } fclose(fpW); This is a piece of Client side code .. i am sending data from Server Side but when i receive …

Member Avatar for dkalita
0
268
Member Avatar for Gchan

hi i need a help in a code.. Code requirement is:- FInd most occuring element in an array.. Say i have an array {1,2,4,4,4,5,1} answer should be 4..... Code should be in C language......

Member Avatar for mrnutty
0
76
Member Avatar for rpjanaka

Hi all, My program have two threads (parent thread & child thread). I want to set a high priority to my child thread when it is created. So I just follow the example given in the follow ([url]http://cs.pub.ro/~apc/2003/resources/pthreads/uguide/users-12.htm[/url]) ************************************************** [code=c] #define _MULTI_THREADED #include <pthread.h> #include <sched.h> #include <stdio.h> #include "check.h" …

Member Avatar for jakethesnake86
0
2K
Member Avatar for katwalatapan

Hello everyone, While implementing POSIX messaging queue, I am encountered with "Message too long error". I have stated 128 bits for my problem, but it still gives the same error. Please do help me in resolving this memory issue. Regards, Tapan. [code=c] #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <mqueue.h> …

Member Avatar for gerard4143
0
1K
Member Avatar for casperguru

What are the difference in the passing mechanism of the following arrays void foo(int* a) void foo(int(&a) [10]) void foo(int a[]) and if all the three absolutely does the same thing then what is the point of keeping 3 of them and does any method have any performance gain as …

Member Avatar for C++NOOOB
0
299
Member Avatar for nateuni

Out of all the possible problems I though I may have in my program, this was not one of them. My menu code is looping twice before stopping for the fgets to take input.. so my menu options are getting printed twice? I have tried flushing the crap out of …

Member Avatar for nateuni
0
601
Member Avatar for Ineedhelpplz

[CODE]#include<stdio.h> #include <stdlib.h> #define MAXLINE 10000 void reverse(char *str); int main() { int c, i; char j; char S[MAXLINE], *p1; p1=S; for(c=getchar(); c!=EOF; i++) { S[i]=c; } reverse(p1); return 0; } void reverse(char *str) { if(*str) { reverse(str+1); putchar(*str); } } [/CODE] Please help me correct the segmentation fault. [QUOTE]blade71(107)% …

Member Avatar for Ineedhelpplz
0
152
Member Avatar for Ineedhelpplz

Instructions: Trailing blanks and tabs are defined as blanks and tabs that precede a '\n' character or an EOF to terminate a line, without any intervening characters of other kinds. You should copy a getline() function of the kind you see in the text to read in lines from stdin …

Member Avatar for Ineedhelpplz
-1
532
Member Avatar for Darknessssss

A simple used car market Design and implement a used car market program.Store the following information for a car: a. ID (unique, can be used as the key) b. Brand c. Model d. Year of manufacturing e. Driven kms f. Price Valid operations are add/update/delete a car and search. User …

Member Avatar for wineandcars
0
150
Member Avatar for duggydiggy

I have come across a strange behavior.. [CODE] #include <stdio.h> #include <conio.h> int strlen(const char *); int main() { char str[]="rahul"; printf("%d",strlen(str)); _getch(); return 0; } int strlen(const char *str) { const char *eostr=str; while(*eostr++); return eostr - str; } [/CODE] Outputs : In VS9 Length:6 // correct In gcc …

Member Avatar for duggydiggy
0
190
Member Avatar for Caglow

I've got a problem with this piece of iterating code: [CODE] /* Iterate to apparent position */ while (a1 != aT) { /* <-- assume a1 == aT here after the 3rd iteration */ a1 = aT; /* Recalculate position */ Venus_C(JDE - aT); /* Calculate */ ep = sqrt(pow(Venus_x(), …

Member Avatar for Caglow
0
380
Member Avatar for konohastar

hi guys, I am a new student in learning C, I have about a month of experience on it and i am learning now how to use loops. I wanted to write a program using loops in which i ask them to guess a password to a question i ask. …

Member Avatar for konohastar
0
241
Member Avatar for Ancient Dragon

There appears to be some confusion about what c++ code snippets are supposed to be. I've seen two threads already that are just normal c++ questions but posted as code snippets. I really don't like intermingling the c++ forum with code snippets for two reasons [list=1] [*]Much more difficult to …

Member Avatar for Dave Sinkula
0
352

The End.