9 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for theburg30

Preconditions: Addresses of 2 integer variables are on the stack as the parameters. Sample c call: swap( &num1, &num2); You must implement the following C swap function: /* Swaps the two values pointed to by x_ptr and y_ptr. */ void swap (int *x_ptr, int *y_ptr) { if (x_ptr != y_ptr) …

Member Avatar for mohamed_101
0
20K
Member Avatar for dendenny01

As for my assignment I had to write a program to swap 2 digit number Example:- If user input 12 the swaped number Would be 21. Along with ALgorithm, and a short description on this program(As how will you solve this program or what measure you'll take to get desired …

Member Avatar for mvmalderen
0
4K
Member Avatar for aVar++

Hi guys, I got this from my teacher and im really confused. could anyone point me in the right direction? Thanks > What does it do? > > This time I'm looking for an overall summary, in one sentence, with the word "by" in the middle: > "This function ..........., …

Member Avatar for Lucaci Andrew
0
208
Member Avatar for aman rathi

Hello everyone first of all thanks to daniweb and all users to help me lots of time. now come to problem i am learning java from last one month today i wrote a program to swap two objects it is running but not performing desired task. all instance fields are …

Member Avatar for aman rathi
0
237
Member Avatar for neoraghav

The following code swaps values between 2 variables without using a temp variable..... i want to know the logic behind this [CODE] //#include "stdafx.h" #include<stdio.h> int main(){ int a =3, b=5; a^=b^=a^=b; printf("%d" "\n" "%d",a,b); return 0; }[/CODE] [CODE]Output 5 3 [/CODE]

Member Avatar for neoraghav
0
4K
Member Avatar for UzuNarU

Hi everyone. I am trying to figure out if it's possible to write a PHP or JavaScript that changes the background image every time the browser refresh button (or F5) is pressed. I haven't seen it done this way, however I have seen it done for banners and other images. …

Member Avatar for UzuNarU
0
202
Member Avatar for goodwillwins

Well i have the following program where i need to swap students(dynamically created structure array) . Just cant seem to get the swap right. Main problem's here : [code=c] struct student *stemp; stemp=(struct student *)malloc(sizeof(student)); *stemp.name=s[i].name; s[i].name=s[j].name; s[j].name=stemp->name; [/code] Other info : [code=c] where s[i] belongs to a dynamically created …

Member Avatar for goodwillwins
0
110
Member Avatar for hkBattousai

[B]MyClass.h[/B][CODE]class MyClass { //... public: template <class T> static void Swap(T& Var1, T& Var2); //... }[/CODE] [B]MyClass.cpp[/B][CODE]template <class T> void MyClass::Swap( T& Var1, T& Var2 ) { Var1 ^= Var2; Var2 ^= Var1; Var1 ^= Var2; }[/CODE] In another file[CODE]#include "MyClass.h" //... int n = 40; int m = 60; …

Member Avatar for hkBattousai
0
2K
Member Avatar for chris5126

Hi, Trying to add a swap file to my server as below: [code] dd if=/dev/zero of=/swapfile1 bs=1M count=2048 2048+0 records in 2048+0 records out 2147483648 bytes (2.1 GB) copied, 27.4514 seconds, 78.2 MB/s [root@clearab2 /]# mkswap -c /swapfile1 Setting up swapspace version 1, size = 2147479 kB [root@clearab2 /]# swapon …

0
118

The End.