1,494 Posted Topics

Member Avatar for dbuckle

I just ran your program and got results..What are you compiling/running this on?

Member Avatar for gerard4143
0
100
Member Avatar for theofilos93

Its simple really. First, create the memory for your c-strings and then read into them. One method [code] #define ARR_SIZE 100 char cstring1[ARR_SIZE];/*100 character array*/ char cstring2[ARR_SIZE];/*100 character array*/ fgets(cstring1, ARR_SIZE, stdin);/*read into cstring1 from the stdin*/ fgets(cstring2, ARR_SIZE, stdin);/*read into cstring2 from the stdin*/ [/code]

Member Avatar for hkdani
0
286
Member Avatar for avani20391

Here's a good example hitting the high points of your question. [url]http://www.metalshell.com/source_code/89/Variable_Argument_List_Example.html[/url] [url]http://msdn.microsoft.com/en-us/library/kb57fad8.aspx[/url]

Member Avatar for gerard4143
0
187
Member Avatar for moshe12007

First question, you start thread with [code] newThread.Start(DataTimes) [/code] Where is DataTimes defined?

Member Avatar for Mitja Bonca
0
443
Member Avatar for Aman6o

Try something like below and it worked for my system. [code] #include <stdio.h> void showbits (unsigned char n) { unsigned char i = 8; for (; i > 0; i--) { n & (1 << (i - 1))? printf ("1"):printf ("0"); } } int main() { unsigned char j = …

Member Avatar for cse.avinash
0
1K
Member Avatar for Sunshine2011

It doesn't work because the member function 'test' has no idea what pAVec is. pAVec is an instance of the object Member created in main. If you require a copy or reference of pAVec in test then pass it via a function parameter.

Member Avatar for Sunshine2011
0
121
Member Avatar for hszforu

Uninitialized arrays are bitwise zeroed..The values for a uninitialized int array are zero.

Member Avatar for hszforu
0
138
Member Avatar for c++_fem
Member Avatar for c++_fem
0
234
Member Avatar for techyworld

Wow, where to begin? First I would get rid of the idea of two arrays and combine them into one array of structures..Like so. [code] struct mys { char * name; int studid; }; struct mys thes[10]; [/code] Before we get into the nuts and bolts..In a C program the …

Member Avatar for gerard4143
0
128
Member Avatar for lxXTaCoXxl

You would probably have better luck with something else...Try getting the MAC address of the network card, that's supposed to be unique.

Member Avatar for skatamatic
0
117
Member Avatar for cvanithakpm

Maybe if you look at this code you'll see what the this pointer is... [code] #include <iostream> class myint { public: myint(int val):itsvalue(val) {} int getitsvalue() const { return itsvalue; } void* get_this() const { return (void*)this; } private: int itsvalue; }; int main(int argc, char**argv) { myint me(1234); std::cout …

Member Avatar for gerard4143
0
119
Member Avatar for maybnxtseasn

Narue beat me to the punch... [code] #include <iostream> struct ch8_struct { int field1; short field2; char field3; int field4; double field5; }; int main(int argc, char**argv) { struct ch8_struct g_StructArray[3]; struct ch8_struct *g_pStructArray = g_StructArray; struct ch8_struct **g_ppStructArray = &g_pStructArray; for (int i = 0; i < 3; ++i) …

Member Avatar for Caligulaminus
0
75
Member Avatar for speak1

Maybe you should've of asked some questions in your class. On a different note. The forum frowns on students posting homework questions and asking for solutions. Please post what you've accomplished so far and ask specific questions about specific problems.

Member Avatar for Zssffssz
0
465
Member Avatar for Mike Askew

I would look into the modulus operator using it something like below. [code] using System; namespace testit { class MainClass { public static void Main (string[] args) { UInt64 x = 0; Console.Write("Enter a four digit number->"); x = UInt64.Parse(Console.ReadLine()); Console.WriteLine(reverse_it(x)); } public static UInt64 reverse_it(UInt64 num) { UInt64 reverse …

Member Avatar for Mike Askew
0
142
Member Avatar for sandman64
Member Avatar for sandman64
0
139
Member Avatar for karthi_selva
Member Avatar for gerard4143
0
127
Member Avatar for karmstrong

Your giveMemoryBack function should be [code] int giveMemoryBack (int *pCDROM, int *pCDROM2, int *pCDROM3) { delete pCDROM1 delete pCDROM2 delete pCDROM3 return 0; } [/code] Note: Remember to set the original pointers back to NULL. Found something else, your function call [code] // Call giveMemoryBack function int giveMemoryBack(int *pCDROM1, int …

Member Avatar for karmstrong
0
129
Member Avatar for edbtzy

Connecting to a MySql database manually is not the way to go...Download the MySql developer files and use that library(MySql's). Note the enclosed code [code] #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <mysql.h>//Note the mysql header file #define SEL_QUERY "select * from personal where lastname = '" #define …

Member Avatar for gerard4143
0
192
Member Avatar for Tom_Weston

If you examine the strchr prototype you'll note it doesn't take a c-string for the second parameter. [code] char *strchr(const char *s, int c); [/code] You'll have to do more than one search if you use this function.

Member Avatar for MonsieurPointer
0
113
Member Avatar for crane476

Shouldn't you do your totalPayroll += payrollAmount in the inner loop? As it is, your inner loop just prompts for and accepts a value for payrollAmount.

Member Avatar for crane476
0
111
Member Avatar for techyworld
Member Avatar for techyworld
0
121
Member Avatar for HackRabbyt
Member Avatar for George_91

You could create a dynamic array with the operator new. [code] int * a = new int[size]; [/code]

Member Avatar for gerard4143
0
160
Member Avatar for techyworld

If your scanf'ing a variable, you must use the address of the variable...If the variable name is an address(like character arrays) then you don't have to use the address of operator on it. example [code] char my_str[] = "This is my string"; int x = 1234; scanf("%s", my_str);//my_str is an …

Member Avatar for techyworld
0
118
Member Avatar for xenan

A question off-topic [code] #include<iostream.h> [/code] What examples/materials are you using that recommend iostream.h?

Member Avatar for gerard4143
0
140
Member Avatar for techyworld
Member Avatar for techyworld
0
205
Member Avatar for guidely

Line 97. What is this [code] if(s[i].sMaxCap <= h[0,1,2,3,4,5,6,7,8,9].maxCap) [/code]

Member Avatar for WaltP
0
221
Member Avatar for iamnot
Member Avatar for swissknife007

left node and right node where left node is greater that right node.

Member Avatar for gerard4143
0
49
Member Avatar for liverpiece
Member Avatar for johnt68
Member Avatar for arunkumars
0
2K
Member Avatar for BobTheLob

For Linux Kernel Modules I just use [code] obj-m += test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean [/code]

Member Avatar for BobTheLob
0
173
Member Avatar for stinkypete

A big hint is the function name - findnoise. I think the function is grabbing whatever stack value int x happens to have and then applying some operations on it...Hopefully returning a quasi random number. Please note this is just a guess....Actually I never noticed the function passed an int …

Member Avatar for gerard4143
0
109
Member Avatar for ZedChu

You could try something like below [code] #include <stdio.h> #include <stdlib.h> #include <ctype.h> unsigned long int readNumbersByGetchar() { unsigned long int thisNumber = 0, i = 0; while ((i = getchar()) != '\n') { if (isdigit(i)) { thisNumber *= 10; thisNumber += atoi((char*)&i);/*This only works for Intel/AMD type integers*/ } …

Member Avatar for ZedChu
0
228
Member Avatar for itunes89

First question. What are you trying to do here? Are you trying to create a Windows form with a progress bar? If you are, this simple example should work. [code] using System; using System.Drawing; using System.Windows.Forms; class myform: Form { ProgressBar my_bar; public myform() { my_bar = new ProgressBar(); my_bar.Minimum …

Member Avatar for itunes89
0
103
Member Avatar for minimi

In your for statement [code] for(i = 0; i < 10; i++) { printf("value, deference pointer, address \n"); printf("pointer1 = %p, *pointer1 = %d, &pointer1 = %p\n", pointer1, *pointer1, &pointer1); pointer1++;//this line should go last } [/code] Or better yet. [code] #include <stdio.h> int main(void) { int values[10] = {1,2,3,4,5,6,7,8,9,10}; …

Member Avatar for gerard4143
0
136
Member Avatar for aKiLa.. :)

[QUOTE=aKiLa.. :);1665425]what all should i include to make it look decent?[/QUOTE] A lot of work....

Member Avatar for sergent
0
217
Member Avatar for guidely

You would be better served if you created an array of structures. [code] #include <stdio.h> #include <stdlib.h> struct mys { int id, size, PerBox; double Price; }; int main() { struct mys thes[5]; return 0; } [/code]

Member Avatar for cse.avinash
0
253
Member Avatar for Jsplinter

Because the data member is const the = operator can't change its value. So using the = operator on any objects from this class will cause an error. Your = operator is defined ~ like so [code] A& A::operator =(const A & obj) { if (this != &obj) { a …

Member Avatar for mike_2000_17
0
599
Member Avatar for virendra_sharma

Then you have to explicitly refer to the members [code] public void a.b() { // TODO: Add Class1.d implementation } [/code]

Member Avatar for gerard4143
0
157
Member Avatar for shawn.reynz

[QUOTE=shawn.reynz;1665898]please help me.. contribute some codes for indegree and outdegree .. i need it badly[/QUOTE] How about you contributing what you have so far.

Member Avatar for sfuo
0
95
Member Avatar for Tom_Weston
Member Avatar for Zssffssz

[QUOTE=tkud;1665544]Declare the variables globally.i.e before main() [/QUOTE] Yikes...Is that good advice? Try reading up on references or pointers. I would try references first before plunging into pointers. Simple reference example. [code] #include <iostream> void square_it(int & i)//pass by reference { i *= i; } int main() { int i = …

Member Avatar for gerard4143
0
170
Member Avatar for geeksforgeek

Try running this code [code] #include <stdio.h> int main(void) { float i=3.3; fprintf(stdout, "%f\n", i - 3.3); fprintf(stdout, "%f\n", 3.3 - i); return 0; } [/code]

Member Avatar for Narue
0
144
Member Avatar for Alvi89

[QUOTE=Alvi89;1665521]people i still cant figure out the problem :O[/QUOTE] We can't figure out what the problem is...Posting a chunk of code and stating that it doesn't work and then giving a brief but confusing explanation doesn't help us.

Member Avatar for Panathinaikos22
0
107
Member Avatar for Tenjune
Member Avatar for Zvjezdan23

Try initializing your array elements before you pass them to your function....Just like your error message indicated.

Member Avatar for Fbody
0
111
Member Avatar for Labdabeta

[QUOTE=Labdabeta;1664881]So it seems like I should use a DLL, but how do I use a DLL?[/QUOTE] That's operating system specific...Which operating system are we talking about here?

Member Avatar for Labdabeta
0
217
Member Avatar for James19142
Member Avatar for James19142
0
878
Member Avatar for Labdabeta

I would try a static member function in myclass to construct the 'hidden' class.

Member Avatar for mike_2000_17
0
234

The End.